> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/quickstarts-1/data-ingestion-wizard/using-the-wizard/source-set-up/microsoft-sql-server.md).

# Microsoft SQL Server

## Step 1 - Connect to SQL Server

### Create a new connection

Click **Create a new connection**, if it is not already selected. You can find instructions on [how to enable SQL Server for CDC in this guide](/content/how-to-guides-1/connectors/enable-cdc/microsoft-sql-server.md).

In the **Connection String** textbox, enter your connection string in the following format:

```markup
jdbc:sqlserver://HOST;DatabaseName=MyDb
```

where:&#x20;

* `HOST` - the hostname or IP address of the SQL Server instance you want to connect to, for example, ms-sqlserver-1.myendpoint.
* `DatabaseName` - the name of the database you want to connect to. The above example uses **MyDb**; replace this with the name of the database you want to work with.

For further connection options, visit [Microsoft SQL Server JDBC URI documentation.](https://learn.microsoft.com/en-us/sql/connect/jdbc/building-the-connection-url?view=sql-server-ver16)

Provide the **Username** and **Password** to authenticate to the database.&#x20;

In the **Name your connection** field, type in the name for this connection. Please note this connection will be available to other users in your organization.&#x20;

<figure><img src="/files/7SHi9X7Gnviul1MCwCo0" alt=""><figcaption><p>Create a new connection to Microsoft SQL Server to ingest your CDC data.</p></figcaption></figure>

### Use an existing connection

By default, if you have already created a connection, Upsolver selects **Use an existing connection**, and your SQL Server connection is populated in the list.&#x20;

For organizations with multiple connections, select the source connection you want to use.&#x20;

<figure><img src="/files/IcTtgGATbaSNH6HVOURu" alt=""><figcaption><p>Select your existing SQL Server connection to use for your ingestion job. </p></figcaption></figure>

## Step 2 - Select schemas, tables, and columns to ingest

There are two ways to replicate objects to the target:

1. Manually select the schemas, tables, and columns.
2. Use regular expressions to specify which tables are included and which columns are excluded.

The following examples show how to use a regular expression to include specific tables:

<table><thead><tr><th width="287.3333333333333">Expression</th><th>Results</th></tr></thead><tbody><tr><td>schema_name.*</td><td>Select all tables in the schema_name schema.</td></tr><tr><td>schema_name.users, schema_name.items</td><td>Select users and items tables in the schema_name schema.</td></tr><tr><td>schema_name.items_.*</td><td>Select all tables in the schema_name schema that start with items_.</td></tr></tbody></table>

By default, Upsolver ingests all columns in the tables that match the regular expression. Below are examples of regular expressions to exclude columns from included tables:

<table><thead><tr><th width="290">Expression</th><th>Results</th></tr></thead><tbody><tr><td>schema_name.users.address_.*</td><td>Select all columns starting with address_ in the users table in the schema_name schema.</td></tr><tr><td>schema_name.*.(.*_pii)</td><td>Select all columns ending in _pii across all tables in the schema_name schema.</td></tr></tbody></table>

**Schema evolution**&#x20;

By default, new schemas, tables, and columns added after the job is launched, will be replicated to the target.

You can overwrite the default behavior and set specific behavior for newly created schemas, tables in a specific schema, or columns in a specific table.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/quickstarts-1/data-ingestion-wizard/using-the-wizard/source-set-up/microsoft-sql-server.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
