# SQL Server

Microsoft SQL Server database

- Category: Databases
- Runs in: the Phloem cloud

Lets you and Hamming query a Microsoft SQL Server database in T-SQL, with its tables listed in Trace.

## What Phloem reads
- Tables, columns and foreign keys of every schema in the database you name, listed in Trace for Hamming and SQL autocomplete
- Base tables only. Views are not listed, but you can still query them by name.

## What you need
- The server's host and port (default 1433), reachable from Phloem's cloud
- The database name
- A SQL Server login (username and password). A read-only login is best.

## Connect
1. In the console, open **Connectors**, choose **Add connector**, then **SQL Server**.
2. Enter a **Display Name**, then **Host**, **Port**, **Database**, **Username** and **Password**.
3. Under **TDS Version**, pick your server's protocol version (default **7.3 (SQL Server 2008+)**).
4. Choose **Test Connection**, then **Create Connection**.

## What Hamming can do
- Run T-SQL that you or Hamming write

## Notes
- Phloem runs any statement, not only `SELECT`. Connect with a read-only login.
- Sign-in uses SQL Server authentication (username and password).

## Connection fields

| Field | Type | Required | Notes |
|---|---|---|---|
| Host | Text | Yes |  |
| Port | Number | No |  |
| Database | Text | Yes |  |
| Username | Text | No |  |
| Password | Secret | No |  |
| TDS Version | One of | No | TDS protocol version |
