# Connect to SQL Server

> Database design software for SQL Server. Connect Schemity to Microsoft SQL Server, understand each connection field, and reverse-engineer the schema offline.

Source: https://schemity.com/doc/connect-sql-server/

Schemity is **database design software for SQL Server**. Connect it to a Microsoft SQL Server instance and it introspects your tables and relationships into a diagram, all locally.

## How do I create a SQL Server connection?

Click **+** above the diagram list, set **DB type** to **SQL Server**, click **Connect to a database**, and set **Connect via** to **Direct connection** (or **SSH Tunnel** to reach a database behind a bastion).

## What do the SQL Server connection fields mean?

- **Host** and **Port** - the server address and port. Port defaults to `1433`.
- **Username** - the login Schemity authenticates as. SQL authentication is the simplest; read-only is recommended.
- **Password** - stored in your OS keychain, never in the JSON file.
- **DB name** - the database to introspect.
- **Schema** - the schema to read. Defaults to `dbo`.
- **Encryption** - **Disable** (local dev only), **Require**, **Verify CA**, or **Verify full (recommended)**; the two verify modes also check the server certificate. See [encryption and certificates](https://schemity.com/doc/connections-overview/#how-do-i-encrypt-the-connection-and-verify-the-server-certificate). Many modern SQL Server setups require encryption.

If you chose **SSH Tunnel**, an extra block asks for the SSH host, port (default `22`), username, password, and an optional SSH key file.

## What does Schemity import from SQL Server?

Schemity imports every table in the target schema: tables and columns with their SQL Server types, primary keys and nullability, foreign keys rendered in crow's foot notation, unique constraints, indexes, and check constraints.

## Next

Save your work to Git, or organize the schema with [Legends & Annotations](https://schemity.com/doc/legends-and-annotations/).
