MS SQL Server

Connect to your MS SQL Server databases.

Getting Started

Prerequisites to create a MS SQL based workflow. You will need

  1. A source MS SQL connection.

  2. (optional) A list of tables OR SQL queries.

  3. (optional) A destination MS SQL connection.

Create a Connection

A mssql connection is created using the following parameters:

Connection Creation Parameters

name

Display name of your choosing used to identify your connection within Gretel.

my-mssql-connection

username

Unique identifier associated with specific account authorized to access database.

john

password

Security credential to authenticate username.

...

host

Fully qualified domain name (FQDN) used to establish connection to database server.

myserver.example.com

port

Port number; If left empty, the default value - 1403- will be used.

1403

database

Name of database to connect to.

mydatabase

(optional) schema

Optional Name of specific schema

dbo

(optional) params

Optional JDBC URL parameters that can be used for advanced configuration.

TrustServerCertificate=True

Creating Connections

First, create a file on your local computer containing the connection credentials. This file should also include type, name , config, and credentials. The config and credentials fields should contain fields that are specific to the connection being created.

Below is an example MS SQL connection:

{
    "type": "mssql",
    "name": "my-mssql-connection",
    "config": {
        "username": "john",
        "host": "myserver.example.com",
        "port": 1443,
        "database": "mydatabase",
        "schema": "dbo",
        "params": "TrustServerCertificate=True"
    },
    "credentials": {
        "password": "..."
    }
}

Now that you've created the credentials file, use the CLI to create the connection

gretel connections create --project [project id] --from-file [credential_file.json]

Last updated

Was this helpful?