> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloud.cdata.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SQL Server Linked Server

> This page outlines the steps to connect SQL Server Linked Server to the Connect AI Virtual SQL Server API.

## Prerequisites

Before you connect, you must first do the following:

* Connect a data source to your Connect AI account. See [Sources](/en/Sources) for more information.
* Generate a Personal Access Token (PAT) on the [Settings](/en/Settings#personal-access-tokens) page. Copy this down, as it acts as your password during authentication.

## Connect to Connect AI

To establish a connection from SQL Server Linked Server to the Connect AI Virtual SQL Server API, follow these steps.

<Steps>
  <Step>
    Open Microsoft SQL Server Management Studio.
  </Step>

  <Step>
    In the **Object Explorer** pane, open **Server Objects**, right-click **Linked Servers**, and select **New Linked Server**.

    <Frame>
      <img src="https://mintcdn.com/cdata/L-wC-3th9ZUn-60n/en/images/sql_client_1.png?fit=max&auto=format&n=L-wC-3th9ZUn-60n&q=85&s=ca04632438c8bfabf877d745dcc86499" alt="" width="441" height="289" data-path="en/images/sql_client_1.png" />
    </Frame>
  </Step>

  <Step>
    The **New Linked Server** dialogue opens. On the **General** page, enter the following information:

    * Enter a memorable name for the server in the **Linked server** field.
    * Select the radio button **Other data source** and select **Microsoft OLE DB Driver for SQL Server** as the provider.
    * In the **Data source** field, enter *tds.cdata.com*,*14333*
    * Leave the other fields empty.

    <Frame>
      <img src="https://mintcdn.com/cdata/L-wC-3th9ZUn-60n/en/images/sql_client_2.png?fit=max&auto=format&n=L-wC-3th9ZUn-60n&q=85&s=20a390097246e8714fc23f468019db63" alt="" width="1851" height="1566" data-path="en/images/sql_client_2.png" />
    </Frame>
  </Step>

  <Step>
    Select the **Security** page. At the bottom, select the radio button labeled **Be made using this security context** and enter the following information:

    * **Remote login**—enter your Connect AI username. This is displayed in the top-right corner of the Connect AI interface. For example, *[test@cdata.com](mailto:test@cdata.com)*.
    * **With password**—enter the PAT you generated on the [Settings](/en/Settings#personal-access-tokens) page.

    <Frame>
      <img src="https://mintcdn.com/cdata/L-wC-3th9ZUn-60n/en/images/sql_client_3.png?fit=max&auto=format&n=L-wC-3th9ZUn-60n&q=85&s=8fa7d505f51317a3100bcc4388df0803" alt="" width="702" height="664" data-path="en/images/sql_client_3.png" />
    </Frame>
  </Step>

  <Step>
    Click **OK** to create the server.
  </Step>
</Steps>

Your linked server can now be used to access the data in the data source you specified. If you need to access data from more sources, create another linked server for each one.
