DataGrip for SQL Server Users: IDE Tour
On this page
"Where's my...?"
Moving to a new IDE is mostly a hunt for things you used to find without thinking. This lesson answers the questions SSMS users ask in their first week with DataGrip, in roughly the order they ask them. Keep training_db from Day 2 open while you read.
Where's Object Explorer? The Database Explorer
It's the Database Explorer, docked on the left (Alt+1 toggles it on Windows and Linux). It works like Object Explorer, with two differences:
- One tree, many servers. Each data source is a top-level node, and they can be different engines. Your SQL Server source and your new PostgreSQL target can sit side by side, which is handy during a migration.
- You choose what's loaded. DataGrip only introspects the databases and schemas you select for each data source. If a schema seems to be missing, it's filtered out, not gone. Open the data source's properties and tick it on the Schemas tab.
To jump to any object by name, press Shift twice (Search Everywhere) and type part of the name. It searches across every data source, which is faster than drilling down the tree.
Where's "New Query"?
DataGrip has two kinds of SQL editor, and the difference matters:
| Query console | Query file | |
|---|---|---|
| Closest SSMS equivalent | A New Query window | A saved .sql script in a project |
| Attached to | One data source | A data source you pick, and you can change it |
| Saved where | DataGrip manages it for you | A file on disk you name, so you can commit it to git |
| Create it | Right-click data source, New, Query Console (Ctrl+Shift+Q) | Right-click data source, New, Query File |
Use consoles for exploration and query files for scripts you'll keep, such as migration scripts. Since DataGrip 2026.1, query files also appear under a Query Files folder inside each data source in the explorer, so your saved scripts sit next to the objects they touch.
Try it: create a console on training_db and run
SELECT current_database(), current_schema();How do I run just one statement?
Put the cursor anywhere inside a statement and press Ctrl+Enter. DataGrip works out where the statement starts and ends, so you don't have to select it first as you might in SSMS. If several statements could match, it asks which one to run. Results appear in the grid at the bottom, and each run gets its own tab, so earlier results stay put.
F5 in SSMS runs the whole window. In DataGrip, select everything (Ctrl+A) and press Ctrl+Enter to run all statements in order.
Where's Script Table As?
Right-click a table and choose SQL Scripts, then Generate DDL to Query Console. You get the CREATE statement for the object, with indexes and constraints, ready to edit.
Can I compare two schemas?
Yes, without a separate tool. In SQL Server you'd use SSDT schema compare or a third-party product. In DataGrip, select two schemas or tables in the explorer (click one, Ctrl+click the other) and press Ctrl+D, or right-click and choose Compare. You get a side-by-side diff of what exists on only one side and what differs.
During a migration this is how you check that the PostgreSQL schema still matches a source that keeps changing. DataGrip can compare objects across engines too, though type names will naturally differ between SQL Server and PostgreSQL.
Can I see a diagram?
Right-click a schema or a few selected tables and choose Diagrams, then Show Diagram. DataGrip draws the tables with their keys and the foreign-key relationships between them. You can drag tables around, hide columns and export the picture for documentation.
Which shortcuts should I learn first?
DataGrip uses JetBrains shortcuts, not SSMS ones. If the switch hurts, Settings, then Keymap, offers a Visual Studio keymap. With the default keymap on Windows and Linux (Cmd replaces Ctrl on macOS), these cover most of a working day:
| Action | SSMS | DataGrip |
|---|---|---|
| Run the current statement | Select it, then F5 | Ctrl+Enter |
| Toggle comment on lines | Ctrl+K, Ctrl+C / Ctrl+K, Ctrl+U | Ctrl+/ |
| Jump to the object explorer | F8 | Alt+1 |
| Find an object by name | Object Explorer filter | Shift, Shift |
| Format SQL | Not built in | Ctrl+Alt+L |
| Autocomplete | Ctrl+Space | Ctrl+Space |
When you can't remember a shortcut, press Ctrl+Shift+A (Find Action) and type what you want to do, such as "compare" or "diagram". It finds every command by name and shows its shortcut.
Check yourself
DataGrip only introspects the schemas selected for that data source. Add reporting on the data source's Schemas tab and the objects appear.
A query file. It's a named file on disk that you can version and run against whichever data source you choose, while consoles are better for quick exploration.
Select the two schemas in the Database Explorer and compare them with Ctrl+D. The diff lists objects that exist on only one side or differ, without any third-party tool.
Place the cursor in the statement and press the execute shortcut (Ctrl+Enter, or Cmd+Enter on macOS). DataGrip picks the statement around the cursor, or asks you to choose when several are possible. That's the closest equivalent to selecting text and pressing F5 in SSMS.
Right-click the table and choose the SQL scripts option to generate its DDL, or open the DDL view for the object. The generated script includes indexes and constraints, which is useful when comparing a migrated table with its SQL Server original.