
## Crawl Microsoft SQL Server

URL: https://docs.atlan.com/apps/connectors/database/microsoft-sql-server/how-tos/crawl-microsoft-sql-server

> Crawl metadata from Microsoft SQL Server to catalog databases, schemas, tables, and views. Extract column details and enable data discovery, lineage tracking, and governance after configuring user permissions.

Extract metadata from your [Microsoft SQL Server](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) databases into Atlan. After completing the prerequisite setup, you can crawl databases, schemas, tables, views, and column-level information to enable discovery and governance. If you use private network access on [Amazon RDS](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-a-private-network-link-to-microsoft-sql-server-on-amazon-rds/llms.txt) or [Amazon EC2](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-a-private-network-link-to-microsoft-sql-server-on-amazon-ec2/llms.txt), complete that setup first. Review the [order of operations](https://docs.atlan.com/llms/catalog/connector-capabilities/order-workflows/llms.txt) for metadata enrichment workflows before starting.

## Prerequisites

Before you begin, make sure you have:

* [Configured Microsoft SQL Server user permissions](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt)
* Set up private network access if needed
* Reviewed the [order of operations](https://docs.atlan.com/llms/catalog/connector-capabilities/order-workflows/llms.txt) for workflow setup

## Create crawler workflow

Follow these steps to create a workflow for Microsoft SQL Server:

1. In your Atlan workspace, click **Connectors** in the left sidebar.
 * If you are using the **Old UI (Classic)**, click **New Workflow** in the top navigation.

2. Click **Marketplace**.

3. Search for **SQL Server Assets** and select it.

4. Click **Install**.

5. Once installation completes, click **Setup Workflow** on the same tile.

### Choose extraction method

Atlan offers two extraction methods to connect to your Microsoft SQL Server instance. Select the method that best fits your security and infrastructure requirements:

:::warning Offline extraction sunset
The offline extraction method has been sunset and is no longer available. For on-premises or network-restricted environments, use the **Agent** extraction method with [Self-Deployed Runtime](https://docs.atlan.com/llms/platform/self-deployed-runtime/llms.txt).
:::

### Direct

Atlan connects directly to your Microsoft SQL Server database to crawl metadata. Choose your authentication method:

#### Basic authentication

To enter your Microsoft SQL Server credentials:

1. For _Host_, enter the [availability group listener](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) name (or PrivateLink endpoint for your Microsoft SQL Server on [Amazon RDS](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-a-private-network-link-to-microsoft-sql-server-on-amazon-rds/llms.txt) or [Amazon EC2](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-a-private-network-link-to-microsoft-sql-server-on-amazon-ec2/llms.txt) instance).

2. For _Port_, enter the port on which Microsoft SQL Server is available (default is 1433).

3. For _Username_, enter the [username you created](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) when setting up user permissions.

4. For _Password_, enter the [password you created](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) when setting up user permissions.

5. For _Database_, enter the name of the database you want to connect to.

6. For _Encrypt Connection_, select **Yes** to encrypt the connection or **No** to disable encryption.

7. Click **Test Authentication** to confirm connectivity to Microsoft SQL Server.

8. Once authentication is successful, click **Next**.

#### Service principal authentication

To enter your Microsoft Entra service principal credentials:

1. For _Host_, enter the [availability group listener](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) name (or PrivateLink endpoint for your Microsoft SQL Server on [Amazon RDS](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-a-private-network-link-to-microsoft-sql-server-on-amazon-rds/llms.txt) or [Amazon EC2](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-a-private-network-link-to-microsoft-sql-server-on-amazon-ec2/llms.txt) instance).

2. For _Port_, enter the port on which Microsoft SQL Server is available (default is 1433).

3. For _Azure AD Principal Application ID (Client ID)_, enter the [application (client) ID you copied](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) for your service principal.

4. For _Azure AD Principal Secret (Client Secret)_, enter the [client secret you copied](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) for your service principal.

5. For _Azure AD Tenant ID_, enter the [directory (tenant) ID you copied](https://docs.atlan.com/llms/connectors/microsoft-sql-server/set-up-microsoft-sql-server/llms.txt) for your service principal.

6. For _Database_, enter the name of the database you want to connect to.

7. For _Encrypt Connection_, select **Yes** to encrypt the connection or **No** to disable encryption.

8. Click **Test Authentication** to confirm connectivity to Microsoft SQL Server.

9. Once authentication is successful, click **Next**.

### Agent

In **Agent** extraction, Self-Deployed Runtime executes metadata extraction within your organization's environment.

1. Install Self-Deployed Runtime if you haven't already:
 - [Install via Docker Compose](https://docs.atlan.com/llms/platform/self-deployed-runtime/install-on-docker-compose/llms.txt)
 - [Install on Kubernetes](https://docs.atlan.com/llms/platform/self-deployed-runtime/install-on-kubernetes/llms.txt)
2. Select the **Agent** tab.

3. Store sensitive information in the secret store configured with the Self-Deployed Runtime and reference the secrets in the corresponding fields. For more information, see [Configure secrets for workflow execution](https://docs.atlan.com/llms/platform/secure-agent/configure-secure-agent-for-workflow-execution/llms.txt).

4. For details on individual fields, refer to the **Direct** extraction tab.

5. Click **Next** after completing the configuration.

### Configure connection

Complete the Microsoft SQL Server connection configuration:

1. Provide a _Connection Name_ that represents your source environment. For example, you might use values like `production`, `development`, `gold`, or `analytics`.

2. To change the users able to manage this connection, change the users or groups listed under _Connection Admins_. If you don't specify any user or group, nobody can manage the connection - not even admins.

3. To prevent users from querying any Microsoft SQL Server data, set `Allow SQL Query` to **No**.

4. To prevent users from previewing any Microsoft SQL Server data, set `Allow Data Preview` to **No**.

5. At the bottom of the screen, click **Next** to proceed.

### Configure crawler

Before running the Microsoft SQL Server crawler, you can further configure it. If an asset appears in both the include and exclude filters, the exclude filter takes precedence.

- To select the assets you want to include in crawling, click **Include Metadata**. (Defaults to all assets if none are specified.)
- To select the assets you want to exclude from crawling, click **Exclude Metadata**. (Defaults to no assets if none are specified.)
- To have the crawler ignore tables and views based on a naming convention, specify a regular expression in the _Exclude regex for tables & views_ field. You can also specify the following system tables to exclude from crawling -  `sys*`, `MSmerge*`, `dbo.sys*`, `MSrepl*`, `IH*`, `MSpeer*`, `cdc.*`, `MS*history`, `MS*agent`, `MSdist*`, `MSpub*`, `MSsubcri*`, `MSdbms*`, `MSdynamic*`, and `MSagent*`. Note: this list isn't exhaustive; for more information, refer to [source documentation](https://learn.microsoft.com/en-us/sql/relational-databases/system-tables/system-tables-transact-sql?view=sql-server-ver16).
- For _Advanced Config_, keep _Default_ for the default configuration or click **Custom** to configure the crawler:
 - For _Enable Source Level Filtering_, click **True** to enable schema-level filtering at source or click **False** to disable it.
 - For _Use JDBC Internal Methods_, click **True** to enable JDBC internal methods for data extraction or click **False** to disable it.

## Run crawler

To run the Microsoft SQL Server crawler, after completing the steps earlier:

1. To check for any [permissions or other configuration issues](https://docs.atlan.com/llms/connectors/microsoft-sql-server/preflight-checks-for-microsoft-sql-server/llms.txt) before running the crawler, click **Preflight checks**.

2. You can either:
 - To run the crawler once immediately, at the bottom of the screen, click the **Run** button.
 - To schedule the crawler to run hourly, daily, weekly, or monthly, at the bottom of the screen, click the **Schedule Run** button.

After the crawler completes, you see the assets on Atlan's asset page! 🎉

## Next steps

* [Mine Microsoft SQL Server](https://docs.atlan.com/llms/connectors/microsoft-sql-server/mine-microsoft-sql-server/llms.txt) - Run the _SQL Server Miner_ to generate lineage from your historical SQL queries.

## See also

Explore Microsoft SQL Server connector references and validation tools.

* [What does Atlan crawl from Microsoft SQL Server](https://docs.atlan.com/llms/connectors/microsoft-sql-server/what-does-atlan-crawl-from-microsoft-sql-server/llms.txt) - Learn about the Microsoft SQL Server assets and metadata that Atlan discovers and catalogs.
* [Preflight checks for Microsoft SQL Server](https://docs.atlan.com/llms/connectors/microsoft-sql-server/preflight-checks-for-microsoft-sql-server/llms.txt) - Verify prerequisites before setting up the Microsoft SQL Server connector.

---
