Find your SQL Server version in three ways
You can check your SQL Server version through SQL Server Management Studio, through a command-line query, or by looking at the Windows registry. The fastest method depends on what you have open right now. If you are already in Management Studio, the query takes 30 seconds. If you are at a command prompt, the registry check is faster. All three methods give you the exact version number you need to know whether your server can run a particular process or whether you need to plan an upgrade.
Your version number matters because software vendors often require a minimum SQL Server version, and older versions stop receiving security updates. Knowing your exact version — not just "SQL Server 2019" but the build number — tells you whether patches have been applied and whether you are running a version that still receives updates from Microsoft.
Key Takeaways
- SQL Server Management Studio shows your version when ready in the Object Explorer window or through a straightforward SELECT query.
- The command line method using sqlcmd works without opening Management Studio and returns results in seconds.
- The Windows registry stores version information and can be checked without any SQL tools installed.
- Your version number includes both the release name (like 2019) and a build number that tells you which patches are installed.
- Microsoft stops releasing security updates for SQL Server versions older than five years, so checking your version helps you plan upgrades.
Check your version in SQL Server Management Studio
Open SQL Server Management Studio and connect to your server. In the Object Explorer pane on the left, right-click the server name at the top and select Properties. The General tab shows the version under "Server version" — it will look something like "15.0.2000.5" for SQL Server 2019 or "14.0.1000.169" for SQL Server 2017. The first number (15, 14, 13) identifies the release; the remaining numbers are the build.
If you prefer a query, open a new query window and run this command:
SELECT @@VERSION;
The result shows the full version string including the operating system and edition. This method works from any query window and is useful if you are already writing SQL code and want to verify the server version without leaving the editor.
Check your version from the command line
Open Command Prompt or PowerShell and run this command:
sqlcmd -S your_server_name -Q "SELECT @@VERSION;"
Replace your_server_name with the actual name of your SQL Server instance. If you are checking the local machine, use a period (.) instead: sqlcmd -S . -Q "SELECT @@VERSION;" The version information appears in the output without needing to open Management Studio.
This method is fastest if you are already at a command prompt or if you want to check the version on a server where you have command-line access but Management Studio is not installed. The sqlcmd tool comes with SQL Server and is usually in your system path after installation.
Check your version in the Windows registry
Press Windows Key + R to open the Run dialog, type regedit, and press Enter. Navigate to this location:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL15.MSSQLSERVER\Setup
The number in the path (15 for SQL Server 2019, 14 for 2017, 13 for 2016) identifies your version. Look for the Version entry on the right side of the window — it shows the build number. This method works even if SQL Server services are stopped or if you cannot connect to the server through Management Studio.
The registry path changes slightly depending on your SQL Server edition and instance name. If you have a named instance instead of the default MSSQLSERVER, the path includes that name. This approach is useful for troubleshooting when the server is not responding to queries.
Understand what your version number means
SQL Server version numbers follow a pattern: the first digit identifies the release year or generation. Version 15 is SQL Server 2019, version 14 is 2017, version 13 is 2016, and version 12 is 2014. The remaining numbers (like 2000.5 or 1000.169) are the build number, which changes with each cumulative update and security patch.
Microsoft releases cumulative updates regularly, and the build number tells you which updates are installed. Two servers both running "SQL Server 2019" might have different build numbers if one has received recent patches and the other has not. Knowing the exact build number helps you determine whether your server has the latest security fixes and whether it meets the requirements for software you want to install.
Check version for a remote SQL Server
If you need to check the version on a server you do not have direct access to, ask the database administrator to run one of the queries above and send you the output. You can also use SQL Server Management Studio to connect to a remote server — open Management Studio, select Connect in Object Explorer, and enter the remote server name or IP address. Once connected, follow the same steps as checking a local server.
If you have command-line access to the remote machine through SSH or Remote Desktop, you can run the sqlcmd command from that machine. For security reasons, remote connections to SQL Server require proper authentication and network access, so confirm with your administrator that you have permission to check the version before attempting a connection.
What to do after you know your version
Once you have your version number, compare it against the requirements for any software you plan to install. Most vendors publish a support matrix showing which SQL Server versions their product supports. If your version is older than the minimum requirement, you will need to plan an upgrade before installing the software.
You can also check Microsoft's support lifecycle page to see when your version stops receiving updates. SQL Server 2016 and earlier versions are no longer supported, meaning Microsoft no longer releases security patches for them. If you are running an unsupported version, upgrading should be a priority, especially if the server handles sensitive data or connects to the internet.
Frequently Asked Questions
What is the difference between the version number and the build number?
The version number (like 15 for SQL Server 2019) identifies which release you are running. The build number (like 2000.5) tells you which cumulative updates and patches have been installed. Two servers with the same version number but different build numbers have different security patches applied.
Can I check the version if I cannot connect to SQL Server?
Yes. The Windows registry method works even if the SQL Server service is stopped or not responding. You can also check the version from the command line using sqlcmd if the service is running but Management Studio cannot connect. If the service is completely down, the registry is your only option without restarting the server.
Does the version number tell me if my server is 32-bit or 64-bit?
No. The version number does not indicate the architecture. You can check this in SQL Server Management Studio by right-clicking the server, selecting Properties, and looking at the Platform field. The registry method also shows this information under the Setup key.
What if I see different version numbers from different methods?
You should not see different numbers from the three methods described here — they all read the same version information. If you do, the registry may be out of sync with the running service, which usually means the server needs to be restarted after an update. Contact your database administrator to verify the version and check for pending restarts.
How often does Microsoft release updates for SQL Server?
Microsoft releases cumulative updates roughly monthly for supported versions. Security patches are released as needed when vulnerabilities are discovered. Your build number increases with each update, so checking it regularly helps you stay current with patches. Your administrator can configure automatic updates or schedule them during maintenance windows.