> ## Documentation Index
> Fetch the complete documentation index at: https://docs.prophecy.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect to MSSQL

> Learn how to connect with Microsoft SQL Server

This page describes how to use and configure a connection to Microsoft SQL Server (MSSQL) in Prophecy. MSSQL is a relational database used for storing and querying structured data.

## Prerequisites

Prophecy connects to Microsoft SQL Server (MSSQL) using the database credentials you provide. These credentials are used to authenticate your session and authorize all data operations during pipeline execution. To use an MSSQL connection effectively, your user account must have:

* `select`, `insert`, `update`, and `delete` on the tables used in your Prophecy pipelines.
* Access to the database and schema where tables are located.

## Feature support

The table below outlines whether the connection supports certain Prophecy features.

| Feature                                                                                    | Supported |
| ------------------------------------------------------------------------------------------ | --------- |
| Read data with a [Source gem](/data-analysis/gems/source-target/external-table/mssql)      | Yes       |
| Write data with a [Target gem](/data-analysis/gems/source-target/external-table/mssql)     | Yes       |
| Browse data in the [Environment browser](/data-analysis/development/studio/studio#sidebar) | Yes       |
| Index tables in the [Knowledge Graph](/data-analysis/ai/knowledge-graph/knowledge-graph)   | No        |

## Connection parameters

To create a connection with Microsoft SQL Server, enter the following parameters:

| Parameter                                                                | Description                             |
| ------------------------------------------------------------------------ | --------------------------------------- |
| Connection Name                                                          | Name to identify your connection        |
| Server                                                                   | Address of the server to connect to     |
| Port                                                                     | Port to use for the connection          |
| Username                                                                 | Username for your MSSQL Server instance |
| Password ([Secret required](/data-analysis/environment/secrets/secrets)) | Password for your MSSQL Server instance |

## Data type mapping

When Prophecy processes data from Microsoft SQL Server (MSSQL) using SQL warehouses, it converts MSSQL-specific data types to formats compatible with your target warehouse. This table shows how [MSSQL data types](https://learn.microsoft.com/en-us/sql/t-sql/data-types/data-types-transact-sql?view=sql-server-ver17) are transformed for Databricks, BigQuery, and Snowflake.

| MSSQL            | Databricks                        | BigQuery                          | Snowflake                         |
| ---------------- | --------------------------------- | --------------------------------- | --------------------------------- |
| tinyint          | `int`<br />Alias: Integer         | `int64`<br />Alias: Integer       | `number`<br />Alias: Number       |
| smallint         | `int`<br />Alias: Integer         | `int64`<br />Alias: Integer       | `number`<br />Alias: Number       |
| int              | `int`<br />Alias: Integer         | `int64`<br />Alias: Integer       | `number`<br />Alias: Number       |
| bigint           | `bigint`<br />Alias: Bigint       | `int64`<br />Alias: Integer       | `number`<br />Alias: Number       |
| float / real     | `double`<br />Alias: Double       | `float64`<br />Alias: Float       | `float`<br />Alias: Float         |
| decimal          | `double`<br />Alias: Double       | `float64`<br />Alias: Float       | `number`<br />Alias: Number       |
| numeric          | `double`<br />Alias: Double       | `float64`<br />Alias: Float       | `number`<br />Alias: Number       |
| money            | `double`<br />Alias: Double       | `float64`<br />Alias: Float       | `number`<br />Alias: Number       |
| smallmoney       | `double`<br />Alias: Double       | `float64`<br />Alias: Float       | `number`<br />Alias: Number       |
| bit              | `boolean`<br />Alias: Boolean     | `bool`<br />Alias: Boolean        | `boolean`<br />Alias: Boolean     |
| char             | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| varchar          | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| text             | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| nchar            | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| nvarchar         | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| ntext            | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| xml              | `string`<br />Alias: String       | `string`<br />Alias: String       | `string`<br />Alias: String       |
| date             | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| time             | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| datetime         | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| datetime2        | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| smalldatetime    | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| datetimeoffset   | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| rowversion       | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp | `timestamp`<br />Alias: Timestamp |
| binary           | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `binary`<br />Alias: Binary       |
| varbinary        | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `binary`<br />Alias: Binary       |
| image            | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `binary`<br />Alias: Binary       |
| uniqueidentifier | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `string`<br />Alias: String       |
| sql\_variant     | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `string`<br />Alias: String       |
| geometry         | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `binary`<br />Alias: Binary       |
| geography        | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `binary`<br />Alias: Binary       |
| hierarchyid      | `binary`<br />Alias: Binary       | `bytes`<br />Alias: Bytes         | `binary`<br />Alias: Binary       |

<Info>
  Learn more in [Supported data types](/data-analysis/gems/data-types).
</Info>

## Sharing connections within teams

Connections in Prophecy are stored within [fabrics](/data-analysis/environment/fabrics/prophecy-fabrics), which are assigned to specific teams. Once an MSSQL connection is added to a fabric, all team members who have access to the fabric can use the connection in their projects. No additional authentication is required—team members automatically inherit the access and permissions of the stored connection credentials.

<Warning>
  Be mindful of the access level granted by the stored credentials. Anyone on the team will have the same permissions—including access to sensitive data if allowed.

  To manage this securely, consider creating a dedicated fabric and team for high-sensitivity connections. This way, only approved users have access to those credentials.
</Warning>
