How to Connect to SQL Server from a Mac (No SSMS Required)
Last updated:
SQL Server Management Studio (SSMS) runs only on Windows, and Microsoft retired Azure Data Studio on February 28, 2026. On a Mac you have three good ways to connect to Microsoft SQL Server, and none of them needs a Windows virtual machine: sqlcmd in Terminal, VS Code with the MSSQL extension, or a native Mac client such as SQLPro for MSSQL.
Everything below was tested from an Apple Silicon Mac against SQL Server 2022 (CU25). For a side-by-side look at every option, including TablePlus, DBeaver, and DataGrip, see the best SQL Server client for Mac. If you are moving off Azure Data Studio, see where to go after Azure Data Studio.
Before you connect
Whichever tool you pick, you need the same four things:
- The server's hostname or IP address, and its port (1433 by default).
- Network reachability. Your Mac must be able to open a TCP connection to that port. If the server sits on a private network, that means a VPN or an SSH tunnel (covered below).
- Credentials: a SQL Server login and password, or Microsoft Entra ID for Azure SQL (see Entra ID MFA sign-in for Azure SQL).
- One syntax quirk worth memorizing: SQL Server tools separate host and port with a comma, not a colon. It is
db.example.com,1433, neverdb.example.com:1433.
Option 1: sqlcmd in Terminal
Microsoft ships a modern, Go-based rewrite of its classic command-line tool, and it installs cleanly through Homebrew:
brew install sqlcmd
Connecting takes a server (-S), a login (-U), and a password (-P):
sqlcmd -S db.example.com,1433 -U sa -P 'YourStrongPassword'
That opens an interactive prompt where you type T-SQL and execute it with GO. For one-off commands, -Q runs a query and exits:
sqlcmd -S localhost,1433 -U sa -P 'YourStrongPassword' -Q "SELECT @@VERSION;"
One encryption detail to know up front. Most SQL Server installs, and every Docker test container, present a self-signed certificate. In our tests, go-sqlcmd connected to such a server without complaint, because by default it negotiates without validating the certificate. The moment you request encryption with -N, validation kicks in and the connection fails unless you either install a trusted certificate or pass -C (trust server certificate). The older ODBC-based sqlcmd, and most current GUI drivers, validate by default, which is where the widespread "certificate chain was issued by an authority that is not trusted" error comes from. The sqlcmd utility documentation spells out the flag behavior, including a heads-up that SQL Server 2025's sqlcmd makes encryption mandatory by default.
sqlcmd is the right tool for scripts, health checks, and CI. It is a poor place to read a 40-column result set.
Option 2: VS Code with the MSSQL extension
Microsoft's official recommendation after the Azure Data Studio retirement is the MSSQL extension for Visual Studio Code. It runs on macOS (Intel and Apple Silicon) and, per Microsoft's documentation, includes an Object Explorer, a results grid with export, a query plan visualizer, table and schema designers, schema compare, and backup and restore.
It is free, and if you already live in VS Code it adds no new application to your dock. The trade-off is that the database lives inside a code editor's panel system, so the experience leans toward developers who mostly write application code and sometimes touch the database.
Option 3: a native Mac client
If SQL Server is where you spend a large part of your day, a purpose-built client is worth the money. SQLPro for MSSQL is a native client for macOS, with iPhone, iPad, Android, and Windows versions, built specifically around SQL Server:
- a connection editor that exposes the encryption and certificate trust settings mentioned above
- Microsoft Entra ID sign-in with MFA for Azure SQL
- an object browser for databases, tables, and views
- a query editor that handles multiple result sets from a single batch
- result export to CSV, JSON, or XML
- built-in SSH tunneling, so remote servers work without a manual tunnel
The honest comparison: sqlcmd and the VS Code extension are free and official; a native client is commercial and, in exchange, treats the database as the main event rather than a sidebar. Plenty of developers use both, a GUI for exploration and sqlcmd for automation. See pricing.
Reaching a remote server: the SSH tunnel
Production databases should not expose port 1433 to the internet, and mostly they don't. If you can SSH into any machine that can reach the database, you can forward a local port through it:
ssh -L 11433:database-host:1433 you@jump-host.example.com
While that session stays open, your Mac's localhost,11433 behaves like the remote server's port 1433, and any of the three tools above can connect to it. The tunnel carries the database protocol as-is; whether the connection is encrypted end to end is still decided by the SQL Server driver settings.
The first-connection errors you are most likely to meet
- "The certificate chain was issued by an authority that is not trusted." The driver defaulted to encryption and the server presented a self-signed certificate. Either trust the certificate explicitly (the
-Cflag, or a trust checkbox in a GUI client) or put a proper CA-issued certificate on the server. Our guide to this error covers both fixes. - "Login failed for user" (error 18456). Wrong password, a login that doesn't exist, or a server configured for Windows authentication only. The client-side message is deliberately vague; the server's error log holds the specific reason.
- A long pause, then a timeout. TCP 1433 is not reachable: a firewall in the way, the wrong port, a named instance listening on a dynamic port, or a server with TCP/IP connections disabled. Test reachability first with
nc -z db.example.com 1433.
Summary
| Tool | Cost | Best for |
|---|---|---|
| sqlcmd (Homebrew) | Free | Scripts, automation, quick checks |
| VS Code MSSQL extension | Free | Developers already working in VS Code |
| Native Mac client (SQLPro for MSSQL) | Paid, free trial | Daily database work, browsing, exports, iPhone and iPad |
A Mac is a perfectly good SQL Server workstation; the retirement of Azure Data Studio just changed which tools fill the gap. Pick the one that matches how much of your day the database occupies, and keep the comma-not-colon port syntax in mind for your first connection.
Try SQLPro for MSSQL -- A native SQL Server client for macOS, iOS, Android, and Windows. No virtual machines required.
Download Free Trial View Pricing Compare SQL Server clients