| title | Check Installed Version of sqlcmd Utility | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| description | Learn how to identify which variant of sqlcmd utility is installed on your system (the go-sqlcmd, or original ODBC variant). | ||||||||||||||||
| author | dlevy-msft | ||||||||||||||||
| ms.author | dlevy | ||||||||||||||||
| ms.reviewer | randolphwest | ||||||||||||||||
| ms.date | 12/16/2025 | ||||||||||||||||
| ms.service | sql | ||||||||||||||||
| ms.subservice | tools-other | ||||||||||||||||
| ms.topic | install-set-up-deploy | ||||||||||||||||
| ms.collection |
|
||||||||||||||||
| ms.custom |
|
||||||||||||||||
| helpviewer_keywords |
|
||||||||||||||||
| zone_pivot_groups | cs1-command-shell | ||||||||||||||||
| monikerRange | >=aps-pdw-2016 || =azuresqldb-current || =azure-sqldw-latest || >=sql-server-2016 || >=sql-server-linux-2017 || =fabric-sqldb |
[!INCLUDE SQL Server Azure SQL Database Azure SQL Managed Instance Azure Synapse Analytics PDW FabricSQLDB]
The sqlcmd utility lets you enter Transact-SQL statements, system procedures, and script files.
There are two variants of sqlcmd:
-
sqlcmd (Go): The
go-mssqldb-based sqlcmd, sometimes styled as go-sqlcmd. This version is a standalone tool you can download independently of [!INCLUDE ssnoversion-md]. It runs on Windows, macOS, Linux, and in containers. -
sqlcmd (ODBC): The platform-aligned, ODBC-based sqlcmd, available with [!INCLUDE ssnoversion-md] or the Microsoft Command Line Utilities, and part of the
mssql-toolspackage on Linux. It also runs on Windows, macOS, Linux, and in containers.
To determine your installed variant and version, run the following statement at the command line:
::: zone pivot="cs1-bash"
sqlcmd "-?"::: zone-end
::: zone pivot="cs1-powershell"
sqlcmd "-?"::: zone-end
::: zone pivot="cs1-cmd"
sqlcmd -?::: zone-end
If you're using the new version of sqlcmd (Go), the output is similar to the following example:
Version: 1.8.2
You can use sqlcmd --version to determine which version is installed. You should have at least version 1.0.0 installed.
If you're using sqlcmd (ODBC), the output is similar to the following example:
Microsoft (R) SQL Server Command Line Tool
Version 16.0.4025.1 NT
Copyright (C) 2022 Microsoft Corporation. All rights reserved.
You might have several versions of sqlcmd (ODBC) installed on your computer. Be sure you're using the correct version. You should have at least version 15.0.4298.1 installed.
Always Encrypted (-g) and Microsoft Entra authentication (-G) require at least version 13.1.
Installing sqlcmd (Go) via a package manager replaces sqlcmd (ODBC) with sqlcmd (Go) in your environment path. You must close and reopen any current command line sessions for this change to take effect. sqlcmd (ODBC) isn't removed, and can still be used by specifying the full path to the executable.
You can also update your PATH variable to indicate which takes precedence. To do so in Windows 11, open System settings and go to About > Advanced system settings. When System Properties opens, select the Environment Variables button. In the lower half, under System variables, select Path and then select Edit. If the location sqlcmd (Go) is saved to (C:\Program Files\sqlcmd is default) is listed before C:\Program Files\Microsoft SQL Server\<version>\Tools\Binn, then sqlcmd (Go) is used. You can reverse the order to make sqlcmd (ODBC) the default again.