This guide provides a concise method to check your SQL Server version directly from the command prompt. Follow these simple steps for a quick and efficient check.
sqlcmdsqlcmd -S <servername>\\<instancename>
<servername> with the name of your server (e.g., "your_server_name") and <instancename> with the name of your SQL Server instance (e.g., "MSSQLSERVER"). If you're connecting to the default instance, you can omit the <instancename> part.1> prompt, enter the following query:SQL
SELECT @@version;
2> prompt, type go and press Enter. This will execute the query.Example
C:\\>sqlcmd -S your_server_name\\MSSQLSERVER
1> SELECT @@version;
2> go
Microsoft SQL Server 2022 (RTM-CU17) (x64)
Copyright (C) 2019 Microsoft Corporation
Standard Edition (64-bit) on Windows
(Build 15.0.4244.1)
In this example:
Note:
U and P options with the sqlcmd command.sqlcmd utility and its options, refer to the Microsoft SQL Server documentation.Knowing your SQL Server version is crucial for:
Yes, you can also check the SQL Server version through: