Check MSSQL Version Via Command Prompt

First day of 2021 and the first blog post….

In situations where you don’t have Microsoft SQL Server Management Studio available or if you just like to use command prompt you can use the command sqlcmd to manage and view your Microsoft SQL Server.

Before start managing your MSSQL server via command prompt you need to know or find out your MSSQL instance name. This can be achieved via command prompt as well, by typing the command “net start” and checking the description within parentheses next to SQL Server. In my case it is the default instance name of MSSQLSERVER.

If you have multiple MSSQL Instances installed there will be one line called SQL Server (Instance Name) per MSSQL Server Instance.

Now let’s check out how to find the MSSQL version via command prompt

  1. Open a command prompt via e.g. Run
  2. type the following command “sqlcmd -s hostname\mssql_instance” where server name is the name of your server, and instancen name is the name of the SQL instance.
  3. type “select @@version”
  4. type “go”

The you go and the result will obviously vary based on your specific MSSQL version.