# Connecting to an MSSQL cloud SQL instance

### **Prerequisites**

Ensure that you have an existing GCP Cloud MSSQL instance.

### **Steps to follow**

1. Go to [this link](http://console.cloud.google.com/sql/instances) where the list of instances will be displayed.
2. Select the required instance from the existing list.
3. If you do not have an existing instance, click on **Create Instance** to create one.
4. On the **Create an instance** page, choose MSSQL database engine from the list.

<figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2FQ0pxP0jDNZLftgNQX6f4%2Fimage.png?alt=media&#x26;token=d3347235-6301-4400-9a73-6f6e4128d38e" alt=""><figcaption><p>Creating an instance</p></figcaption></figure>

5. In the **Primary Instance** pane on the left side, select **Connections** and click on the **Networking** tab.
6. Under **Instance IP assignment**, click on the **Public IP** checkbox.

<figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2FkaE6qtgdeIH87aMkmKVJ%2Fimage.png?alt=media&#x26;token=342b2627-103e-47ec-af19-48abd6ac849e" alt="" width="563"><figcaption><p>Choosing Public IP</p></figcaption></figure>

7. Click on **Add a network** under the **Authorized networks** section. **New network** section will open.

<figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2FZ4DpdTTZdkP49ot3XLhY%2Fimage.png?alt=media&#x26;token=c49c12d9-7344-4d8e-a6f2-769863f7f719" alt="" width="563"><figcaption><p>Adding a new network</p></figcaption></figure>

8. Provide a **Name** and **IP address** in the respective fields. Click on **Done** and click on **Save**.

{% hint style="info" %}
Please note that the IP address in CIDR notation will be provided by the Tellius team.
{% endhint %}

9. Under the **Security** tab, ensure that the checkbox **Allow only SSL connections** is left unchecked.

<figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2F7VOwDf7w7WAE4Yqik6Xa%2Fimage.png?alt=media&#x26;token=d80674ed-7dc1-4133-80e3-9f249498c152" alt="" width="563"><figcaption><p>Unchecking "Allow only SSL connections"</p></figcaption></figure>

{% hint style="info" %}
If *Only secured connections are allowed to connect to this instance* is displayed, click on **Allow unsecured connections**.\
\
If *Unsecured connections are allowed to connect to this instance* is displayed, you do not need to change anything.
{% endhint %}

10. From the GCP console, please note the following details, as they will be required when setting up the connection on the Tellius platform:

    * Under the **Summary** tab, copy the **Public IP address**.

    <figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2FK2602fUzzgmR3Tk1JoLi%2Fimage.png?alt=media&#x26;token=b74606e2-f84d-4c2f-872e-05eabf6122ad" alt=""><figcaption><p>Copying public IP address</p></figcaption></figure>

    * In the **Primary Instance** pane, select **Databases**. From the list of databases, copy the name of the required database.
    * In the **Primary Instance** pane, select **Users**. From the list of users, copy the name of the required user.
11. In the Tellius platform, navigate to **Data → Connect → Create New → MSSQL**.

<figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2FQPxapbZTADTwZZHBYnWn%2Fimage.png?alt=media&#x26;token=11a01f8a-f6bf-4913-9358-234c844032a8" alt="" width="563"><figcaption><p>Data → Connect → Create New → MSSQL</p></figcaption></figure>

12. Paste the IP address in the **Hostname** field.
13. Provide the default port number 1433 in the **Port** field.
14. Paste the copied database name in the **Database** field.
15. Paste the copied user name in the **User** field.
16. Provide the required password in the **Password** field.
17. Click on **Save and Browse Host** (or **Browse Host** if you are using an already established connection). The list of tables from the data source will be displayed on the right side.

<figure><img src="https://977923713-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FJHwf1QFuv1BRPzfSnL2Z%2Fuploads%2Fur3r08nZhLAx40sSeGgL%2Fimage.png?alt=media&#x26;token=764add5c-b0c2-4d05-b959-4d11f7c7e3e2" alt="" width="563"><figcaption><p>After establishing a connection</p></figcaption></figure>
