Connect Microsoft SQL Server to JetBrains DataGrip by installing the SQL Server driver, supplying a valid JDBC URL, and testing with a sample query.
It means registering your SQL Server instance as a DataGrip data source so you can run queries, browse schemas, and use DataGrip tooling.
• SQL Server host name, port (default 1433), and database name.
• Login that can SELECT from the target database.
• DataGrip 2021.1+ with Internet access to download the Microsoft JDBC driver.
Click + → Data Source → SQL Server. DataGrip downloads the driver automatically.
Host, Port, Database, User, and Password are required. Leave the URL field blank—DataGrip builds it for you.
In the Advanced tab set encrypt=true
. If the server uses a self-signed cert, also set trustServerCertificate=true
.
Click Test Connection.Green check = success. Click OK to persist the data source.
.
Use the pattern below when scripting or pasting directly into the URL field.
jdbc:sqlserver://HOST:PORT;databaseName=DB_NAME;encrypt=true|false;
trustServerCertificate=true|false;loginTimeout=30
Add any property accepted by the Microsoft JDBC driver, such as applicationName
or socketTimeout
.
Run a simple query on a known table.
SELECT TOP 5 id, name, email
FROM Customers
ORDER BY created_at DESC;
If rows return without error, the data source is ready.
• Use a least-privilege login that can only read the needed schemas.
• Store credentials in DataGrip’s KeePass or OS keychain.
• Name the data source after the environment, e.g., prod-sql-server.
Wrong port: Leaving the port blank defaults to 1433. If your instance listens on 14330, specify it or the test will fail.
Untrusted SSL: Enabling encrypt=true
without trustServerCertificate=true
on self-signed setups causes handshake errors. Add the flag or import the cert.
The statement below joins Orders and OrderItems to compute total quantity per order.
SELECT o.id AS order_id,
SUM(oi.quantity) AS total_items
FROM Orders o
JOIN OrderItems oi ON oi.order_id = o.id
GROUP BY o.id;
Yes. The first time you add an SQL Server data source, DataGrip downloads the Microsoft JDBC driver automatically. You only need Internet access.
Yes. On Windows, choose the Authentication → Integrated option. Ensure you run DataGrip under a domain account that has SQL Server access.
By default, DataGrip encrypts passwords in ~/.DataGrip/config/jdbc-drivers or stores them in your OS keychain if enabled.