> For the complete documentation index, see [llms.txt](https://docs.telm.ai/telmai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.telm.ai/telmai/connect-to-data/data-connections/sql-server.md).

# SQL Server

## Creating a connection

To connect to SQL Server, you'll need to provide the below details:

{% hint style="info" %}
Fill in following details in the form. We use Azure SQL service as an example here:
{% endhint %}

1. **Connection Type**: MS SQL Server
2. **Name**: A name for the connection
3. **Description**: An optional description
4. **Schema**: The schema to connect to
5. **Server**: The server name. It can be found in Azure Portal: *SQL Server -> Server Name -> Overview -> Server Name*
6. **Database**: The database name. This can be found in the Azure Portal at the following location: *SQL Server -> Server Name -> Overview -> Available Resources -> (x) databases*.
7. **Port**: The server port, typically `1433`
8. **Authentication Scheme**: How Telmai authenticates to the server — see [Authentication schemes](#authentication-schemes) below
9. **User** and **Password**: The credentials, when the selected scheme requires them

<figure><img src="/files/BHAaj2IQy71hW7i40R4Q" alt="The Create Connection panel for MS SQL Server with the Authentication Scheme dropdown open"><figcaption><p>Creating an MS SQL Server connection, with the <strong>Authentication Scheme</strong> list open.</p></figcaption></figure>

Select **Test Connection** to validate the details. The connection can only be created once a test succeeds.

### Authentication schemes

| Scheme                        | What it uses                                                                                                                                                                                                                                                                |
| ----------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SQL Server Authentication     | A SQL Server username and password, stored on the connection                                                                                                                                                                                                                |
| Microsoft Entra Password      | A Microsoft Entra username and password, stored on the connection                                                                                                                                                                                                           |
| Managed Identity (connection) | A managed identity registered by a Telmai administrator — no user or password is stored. Available on Azure-based Telmai deployments only; see [Azure SQL Server: Managed Identity Authentication](/telmai/connect-to-data/data-connections/sql-server-managed-identity.md) |

{% hint style="info" %}
Note:

* The **User** and **Password** fields apply to the SQL Server Authentication and Microsoft Entra Password schemes. Managed Identity (connection) replaces them with an identity picker and stores no password at all.
* In order to connect to a privately hosted instance, the customer will need to whitelist the IPs from Telmai. Please reach out to Telmai support for the updated list of IP’s for whitelisting.
  {% endhint %}

## Connecting an asset

Once a connection is defined, you can start using it to create assets. To create assets, you will need to select existing table, or run a custom SQL query.

<figure><img src="/files/O7wsajEG08l1T4fnCJfG" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
JSON data type is not supported for SQL Server connections out of the box. Please reach out to Telmai support if it needs to be enabled
{% endhint %}

{% hint style="info" %}
Please ensure that your environment has whitelisted [Telmai IP list](/telmai/api-reference/telmai-ip-list.md).
{% endhint %}
