The fastest way to find your SQL Server version
The quickest method is to open SQL Server Management Studio, connect to your server, and run a single query. In the query window, type SELECT @@VERSION; and execute it. The result shows your SQL Server edition, version number, build, and operating system in one line.
If you do not have Management Studio installed or prefer not to open it, you can check the version from the Windows command line using sqlcmd, or look it up directly in the Windows Registry or file system. Each method takes less than a minute and requires no special permissions beyond access to the server itself.
Key Takeaways
- Running SELECT @@VERSION; in SQL Server Management Studio returns the complete version information in seconds.
- The Registry path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server stores version details if you cannot connect to the server.
- The sqlcmd command-line tool lets you check the version without opening Management Studio.
- Version numbers follow the pattern 15.x for SQL Server 2019, 14.x for 2017, and 13.x for 2016, making it easy to identify the release year.
Using SQL Server Management Studio
Open SQL Server Management Studio and connect to the instance you want to check. In the query editor window, paste SELECT @@VERSION; and press F5 or click Execute. The output appears in the Results tab below and includes the full version string.
The version string breaks down into readable parts: it starts with the product name (SQL Server 2019, 2017, etc.), followed by the exact build number, the service pack level if one is installed, and the operating system. For example, a result might read "Microsoft SQL Server 2019 (RTM-CU10) (KB5001090) - 15.0.4123.1 (X64)". The number 15.0 tells you it is SQL Server 2019; 14.0 would be 2017.
Checking the version from the command line
If you prefer not to use the GUI, open Command Prompt or PowerShell and use the sqlcmd utility. Type the command sqlcmd -S your_server_name -Q "SELECT @@VERSION;", replacing your_server_name with the actual server name or IP address. The version information prints directly to the terminal.
For a local default instance, you can omit the server name and use sqlcmd -Q "SELECT @@VERSION;" alone. If your instance has a specific name (not the default), include it after a backslash: sqlcmd -S your_server_name\INSTANCE_NAME -Q "SELECT @@VERSION;". This method works on any machine with sqlcmd installed, even if Management Studio is not present.
Finding the version in the Windows Registry
The Registry stores SQL Server version information even if the service is not running. Press Windows Key + R, type regedit, and press Enter to open Registry Editor. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server.
Look for a folder named after your instance (the default is MSSQL15.MSSQLSERVER for SQL Server 2019, MSSQL14.MSSQLSERVER for 2017). The first number in the folder name indicates the version: 15 = 2019, 14 = 2017, 13 = 2016, 12 = 2014. Inside that folder, open the Setup folder and look for the Version value on the right side to see the exact build number.
Identifying the version from file properties
You can also check the version by looking at the properties of the SQL Server executable file. Navigate to the SQL Server installation folder, typically C:\Program Files\Microsoft SQL Server\MSSQL15.MSSQLSERVER\MSSQL\Binn (the 15 changes based on version). Right-click on sqlservr.exe and select Properties.
Click the Details tab. The Product Version field shows the version number, and the File Version field shows the build. This method works without needing to start the service or connect to the database, making it useful if the server is offline or experiencing connection issues.
Understanding version numbers and build identifiers
SQL Server version numbers follow a consistent pattern that makes it easy to identify which release you are running. The major version number appears first: 15.x is SQL Server 2019, 14.x is 2017, 13.x is 2016, and 12.x is 2014. The second number (after the decimal) indicates the service pack or cumulative update level.
Build numbers are more specific. A build like 15.0.4123.1 breaks down as: 15 (SQL Server 2019), 0 (RTM or initial release), 4123 (cumulative update number), and 1 (hotfix revision). Microsoft publishes a reference table on their website that maps build numbers to specific cumulative updates, which is useful if you need to know exactly which patches are installed.
Checking multiple instances on one server
If your machine runs multiple SQL Server instances, you need to check each one separately. In Management Studio, the instance name appears in the connection dialog and in the server name at the top of the query window. Connect to each instance and run SELECT @@VERSION; to see its individual version.
From the command line, specify each instance name explicitly: sqlcmd -S your_server_name\INSTANCE_1 -Q "SELECT @@VERSION;" and then sqlcmd -S your_server_name\INSTANCE_2 -Q "SELECT @@VERSION;". In the Registry, each instance has its own folder under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server, so you can check the version of each one without connecting.
Frequently Asked Questions
What does RTM mean in the version string?
RTM stands for Release to Manufacturing, which means the initial release of that SQL Server version with no service packs or cumulative updates applied. If you see RTM in your version string, your server is running the base release. Most production servers have at least one cumulative update installed, which replaces RTM with a CU number.
Can I check the version if I cannot connect to the server?
Yes. Use the Registry method or check the file properties of sqlservr.exe. Both work without needing an active connection. If the SQL Server service is not running, these methods still show you the installed version. You can also ask your system administrator to check the version on your behalf if you do not have local access.
Why do I need to know the exact build number?
Build numbers tell you which cumulative updates and hotfixes are installed. This matters for security patches, bug fixes, and compatibility with applications or tools. If you are troubleshooting a known issue, Microsoft support often asks for the exact build number to determine whether a fix has been applied.
Is there a difference between the version shown in Management Studio and the Registry?
No. Both sources show the same version information because Management Studio queries the same system that the Registry reflects. The query result and the Registry value will always match for the same instance.
What if the version number does not match the SQL Server edition I installed?
This usually means an in-place upgrade was performed. For example, upgrading from SQL Server 2017 to 2019 changes the version number from 14.x to 15.x. If the mismatch seems wrong, verify that you are connected to the correct instance and server name.