# Microsoft SQL Server

Bobby Tables connects to Microsoft SQL Server over TCP with SQL Server authentication and opens each connection in a SQL workspace with T-SQL formatting and quoting.

## Where to find it

| Action | How |
| --- | --- |
| Choose SQL Server | `New connection`, `⌘N` (`Ctrl+N`), then `Microsoft SQL Server` under `Choose a provider` |
| Fill the form from a URL | `Use connection URL` with a `sqlserver://` or `mssql://` URL, then `Fill fields` |
| Default port | `1433` |
Searching the chooser for `mssql` also finds it.

## Connecting

The form asks for `Host`, `Port`, `User`, `Database (optional)` and `Password`, and notes that the connection `Uses 2 server connections`. Below the fields it says `SQL authentication and explicit TCP ports only. Integrated authentication and named instance discovery are unavailable.`, and a host written with an instance name is refused with `Use a host and explicit TCP port`. `Open in read-only mode` blocks writes in the app and disables editing.

## What works

- Browse schemas, tables, views, routines, triggers, keys and indexes in the [table grid](https://bobbytables.app/docs/table-data).
- Stage inserts, updates and deletes on tables with a primary key, as described in [Editing](https://bobbytables.app/docs/editing). Identity, computed and rowversion columns are not written.
- Change structure in the [Structure](https://bobbytables.app/docs/structure) tab, with supported DDL run inside a transaction.
- [Snapshots](https://bobbytables.app/docs/snapshots) are not available, so `Create snapshot...` does not appear.
- Draw a [schema diagram](https://bobbytables.app/docs/schema-diagram) from declared foreign keys.
- Format result columns with [result directives](https://bobbytables.app/docs/result-directives).
- Stop a running statement with `Cancel`, `⌘.` (`Ctrl+.`), and keep using the connection afterwards.
- Run `Explain`, `⌘⇧E` (`Ctrl+Shift+E`), in the [SQL editor](https://bobbytables.app/docs/sql-editor).

## Engine notes

SQL Server authentication is the only sign-in method, so Windows integrated authentication, Kerberos and named-instance discovery are not available on any platform. New connections start on `Verify Full` in the `TLS` section, which checks the certificate and host name, while `Require` encrypts without checking; see [SSH and TLS](https://bobbytables.app/docs/ssh-and-tls). A custom CA certificate is supported, client certificates are not, and host name checks still apply through an SSH tunnel. Deadlocks and in-memory transaction conflicts appear as statement errors with their SQL Server error code, and the app never replays a transaction.

## Good to know

- A table without a primary key stays read-only, with a banner saying why.
- Values such as decimals, unique identifiers and datetime offsets arrive exactly as stored.

## Related

- [SSH and TLS](https://bobbytables.app/docs/ssh-and-tls.md)
- [SQL editor](https://bobbytables.app/docs/sql-editor.md)
- [Editing](https://bobbytables.app/docs/editing.md)
- [Engines, file sources and platforms](https://bobbytables.app/docs/engines.md)
