DataGrip 2018.3 Help

How to connect to MS SQL server

SQL developers can rely on DataGrip when they need to connect to the SQL Server from OSX or by using Windows authentication. This tutorial covers all steps that you need for a successful SQL Server connection.

Ensure that options in SQL Server Configuration Manager are configured correctly, and the SQL Server Browser is running.

Ensure that the SQL Server Browser is running

Enable TCP/IP connections.

Enable TCP/IP connections

To get information about the port for the connection, click TCP/IP. In our case, it is 1433 (a default port).

Get information about the connection port in TCP/IP properties

If you changed any settings, restart the server. For most situations, the restart will resolve connection problems. If you still have problems, check the TCP port configuration, or enable a remote connection to the SQL server in the server settings.

Open the Database view (Alt+1) and create a data source with the appropriate driver. In this tutorial, we assume that it is the jTds driver.

Configure SQL Server in DataGrip

If you have no driver, click the link to download it.

Click the Download missing drivers link

Specify the host name, the instance name and the credentials. Remember that DataGrip offers completion for host, instance and database names (N/A), but the database name is optional. These fields might be familiar for users who are used to the SQL Server Management Studio (SSMS) interface, compare the following connection windows of SSMS and DataGrip.

Compare the connection windows

In the jTds driver, if the port number conflicts with the instance name, the instance name takes precedence over the port number. In the Microsoft driver, the port number takes precedence over the instance name. To avoid confusion, remove the port number. If you want to specify the port number, click the Auto-set button (located to the right of the Instance field) to set the port number automatically.

Compare the connection windows

If you need to use Windows authentication, you can simply use the Microsoft driver.

Windows authentication with the Microsoft driver

Alternatively, you can connect to the server from any other machine with Windows authentication by using the jTds driver. The jTds driver is multiplatform.

To establish the connection with the jTds driver, go to the Advanced tab of data source properties, set USENTLMV2 to true, and specify the domain name in the DOMAIN field.

Configure data source properties on the Advanced tab

Type your Windows credentials in User and Password fields, and click Test Connection.

If you want to select what databases or schemas to show in the Database view, go to the Schemas tab in the data source properties:

Check which particular databases or schemas are shown

In case you use DataGrip 2016.2 and later, click More Schemas in the Database view:

Show more schemas

All selected databases will appear in the Database view. See how it looks in SQL Server Management Studio:

Selected databases in SQL Server Management Studio

And here is the look in DataGrip:

Selected databases in DataGrip
Last modified: 6 February 2019