How to tell what SQL Server versions you are running
One issue that I am often faced with is determining the version of the database engine installed on SQL Server. In this tip we look at how to find the version of SQL Server that is running and also what service pack, hotfix, security update or cumulative update is installed.
Solution
There are a few ways to determine the version of SQL Server that is installed which we will cover in this tutorial.
How to tell what version of Microsoft SQL Server you are running?
- One simple way to do this is to run SELECT @@version
- Another option is to right click on the SQL Server instance name in SSMS and select Properties
- You can also use the SERVERPROPERTY function to get details about the version of SQL Server
- Check out all of the methods in this tip.
Method 1 — Find Microsoft SQL Server Version with SSMS
The first is by using the functionality in SQL Server Management Studio and right clicking on the instance name and selecting Properties. In the general section you will see information such as on the following screenshots. The «Product version» or «Version» gives you a number of the version that is installed. As you can see with the SQL Server 2000 screenshot it also shows you the service pack that is installed, this is similar for SQL Server 6.5 and SQL Server 7.0 in Enterprise Manager.
SQL Server 2000
SQL Server 2005
SQL Server 2008 / 2008 R2 / 2012 / 2014 / 2016 / 2017 / 2019 / 2022
This will look similar for all of these versions of SQL Server.
Method 2 — Find Microsoft SQL Server Version with T-SQL
Another option is to run the T-SQL command to give you this information. As you can see the output from the different versions of SQL Server and Windows Server is pretty much the same. The one thing that you do not get when you do this is the Service Pack name like you do in Enterprise Manager.
When this is T-SQL code or a stored procedure with this command is run it will give you information such as the build number and Windows Server operating system:
SQL Server 2000
Microsoft SQL Server 2000 — 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
SQL Server 2005
Microsoft SQL Server 2005 — 9.00.1399.06 (Intel X86)
Oct 14 2005 00:33:37
Copyright (c) 1988-2005 Microsoft Corporation
Developer Edition on Windows NT 5.1 (Build 2600: Service Pack 2)
SQL Server 2008
Microsoft SQL Server 2008 (SP1) — 10.0.2573.0 (X64)
Feb 4 2011 11:27:06
Copyright (c) 1988-2008 Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 (Build 7601: Service Pack 1)
SQL Server 2008 R2
Microsoft SQL Server 2008 R2 (RTM) — 10.50.1600.1 (X64)
Apr 2 2010 15:48:46
Copyright (c) Microsoft Corporation
Enterprise Edition (64-bit) on Windows NT 6.0 <X64> (Build 6002: Service Pack 2)
SQL Server 2012
Microsoft SQL Server 2012 — 11.0.2100.60 (X64)
Feb 10 2012 19:39:15
Copyright (c) Microsoft Corporation
Web Edition (64-bit) on Windows NT 6.1 <X64> (Build 7601: Service Pack 1) (Hypervisor)
SQL Server 2014
Microsoft SQL Server 2014 — 12.0.2254.0 (X64)
Jul 25 2014 18:52:51
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows NT 6.1 <x64> (Build 7601: Service Pack 1) (Hypervisor)
SQL Server 2016
Microsoft SQL Server 2016 (RTM) — 13.0.1601.5 (X64)
Apr 29 2016 23:23:58
Copyright (c) Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Pro 6.3 <x64> (Build 14393: )
SQL Server 2017
Microsoft SQL Server 2017 (RTM) — 14.0.1000.169 (X64)
Aug 22 2017 17:04:49
Copyright (C) 2017 Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 16299: )
SQL Server 2019
Microsoft SQL Server 2019 (RTM) — 15.0.2000.5 (X64)
Sep 24 2019 13:48:23
Copyright (C) 2019 Microsoft Corporation
Developer Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 17763: )
SQL Server 2022
Microsoft SQL Server 2022 (CTP2.0) — 16.0.600.9 (X64)
May 20 2022 13:29:42
Copyright (C) 2022 Microsoft Corporation
Enterprise Evaluation Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64> (Build 17763: ) (Hypervisor)
Method 3 — Find SQL Server version by exe file details
Another option to determine the version of the SQL Server database install is to look at the version of the SQL Server files. This is an option if SQL Server is not running and you need to find the version.
Open Windows Explorer and navigate to the folder where SQL Server is installed such as «C:\Program Files\Microsoft SQL Server\MSSQL10.SQL2008\MSSQL\Binn», for SQL Server 2008.
Find file sqlservr.exe and right click and select properties and a window will open like the one below. Here we can see that this file is version 10.0.2573.0.
Method 4 — Find SQL Server version with SERVERPROPERTY
One of our readers, Ben Pomicter, also suggested this method using the SERVERPROPERTY function.
When run it returns results similar to the following:

What do these SQL Server Build Numbers Mean?
So now that you have this number such as 9.00.1399.06 or 8.00.760 what do these build numbers even mean? The first digits refer to the version of SQL Server such as:
- 8.0 for SQL Server 2000
- 9.0 for SQL Server 2005
- 10.0 for SQL Server 2008
- 10.5 for SQL Server 2008 R2
- 11.0 for SQL Server 2012
- 12.0 for SQL Server 2014
- 13.0 for SQL Server 2016
- 14.0 for SQL Server 2017
- 15.0 for SQL Server 2019
- 16.0 for SQL Server 2022
Here are a couple of links to other articles that give you the details of what is installed for SQL Server 6.0, 6.5, 7.0, 2000, 2005, 2008, 2008 R2, 2012, 2014, 2016, 2017, 2019 and 2022 based on the version number that is returned.
- SQL Server Builds and Service Pack Information (this is the most complete list)
- How to identify your SQL Server version and edition
Next Steps
- Keep these links handy to determine what version of SQL Server you are running


About the author
alt=»MSSQLTips author Greg Robidoux» width=»100″ height=»150″ /> Greg Robidoux is the President and founder of Edgewood Solutions, a technology services company delivering services and solutions for Microsoft SQL Server. He is also one of the co-founders of MSSQLTips.com. Greg has been working with SQL Server since 1999, has authored numerous database-related articles, and delivered several presentations related to SQL Server. Before SQL Server, he worked on many data platforms such as DB2, Oracle, Sybase, and Informix.
Article Last Updated: 2022-06-09
Comments For This Article
| Thursday, April 27, 2023 — 12:37:08 PM — Greg Robidoux | Back To Top (91136) |
| Thanks C Little. Using @@VERSION is one of the options listed above. | |
| Thursday, April 27, 2023 — 11:55:17 AM — C Little | Back To Top (91135) |
| Why not just run this?
This is what I use for server info Find server details All: Hi Sergei, sure you could use the RTM version, but there have been several cumulative updates since the RTM release and it would make sense to apply the updates. Could�rtm version of SQL Server 2017 be installed in a production environment? Thank you very much! Method 4 was exactly what i was looking for.� Thanks a lot for your Method 4 was an excellent additoin and worked great. Thanks How to check sql server version [All the instances], IS, AS and RS version along with service startup type and service acount details, Method 5 Works on SQL Server 2016 & SQL Server 2014 SP1+ SELECT SERVERPROPERTY (‘ProductMajorVersion’) AS ‘ProductMajorVersion’ Thanks Ben for another way to get this data. I will update the tip to include your script. I’m surprised the SERVERPROPERTY function isn’t mentioned. That would seem to be the most straightforward way, especially if you’re pulling version/edition/SP into a report or repository (easier than parsing the output of @@VERSION), e.g. select CASE WHEN CONVERT(VARCHAR(128), SERVERPROPERTY (‘productversion’)) like ‘8%’ THEN ‘SQL2000’ which would give output such as MajorVersion ProductLevel Edition ProductVersion Method 3 was able to easily provide me with all the info I needed. Unfortunately, I have found that the version # does not reflect the patch level. The version # represents the base level for the SQL Server installation. However, if you want to know if your server has the latest patches, you need to check the OS Registry. Do you know of a tool that can provide the patch level for SQL server? The MAP tool only provides the version #. Awesome, thanks so much for taking the time to write this. As usual, a third party source of information is far superior to that of Microsoft themselves. Kudos. You could also use xp_msver to retrieve the SQL version and the OS version, but in a table form that is more comprehensable. Take a look at these posts to see if this gives you want you need: I think if you run SELECT @@VERSION it will say it is an evaluation edition. How do you decipher if it is a Demo version with an expiration date? Another link in Spanish: Hi Geoff, I guess technically if the only access to SQL Server is the server itself and there are no connections from other machines just having the server level license should be sufficient. Take a look at this document for more info on SQL 2005 licensing: http://download.microsoft.com/download/e/c/a/ecafe5d1-b514-48ab-93eb-61377df9c5c2/SQLServer2005Licensingv1.1.doc If you purchase: SQL Server 2005 Standard Full edition with Product Key. That the owner says «does not have a CAL with it.» What does that really mean? (*Understand, that we are not wanting to network version) Can you still run SQL 2005 as a single User on a single PC? OR do you have to purchase an actual CAL to make it work? Iain, thanks for letting me know. That link has been updated and now when you get to that page you need to select the version of SQL Server you are working with. Good article apart from http://www.sqlsecurity.com/FAQs/SQLServerVersionDatabase/tabid/63/Default.aspx — SQL Server versions (this is the most complete list) That’s a dead link. The tip has been updated to reflect the note above from James. «The first is by using either Enterprise Manager or SQL Server Management Studio and right clicking on the database instance name and selecting properties.» Как узнать версию установленного SQL сервера?Добрый день, я знаю про SELECT @@VERSION, а есть другие способы?
Есть 2 основных ситуации при получении версии Microsft SQL Server:
Рассмотрим сначала первый вариант. Большая часть информации доступна и поддерживается в актуальном виде в отличной и крайне рекомендуемой к прочтению KB321185: Определение версии, выпуска и уровня обновления системы SQL Server и ее компонентов Подключитесь к серверу через SSMS. После подключения в обозревателе объектов в нем будут отображаться сведения о выпуске (в скобках), наряду с именем пользователя, которое используется для подключения к конкретному экземпляру SQL Server. С помощью запроса: SELECT @@VERSION; . Пример вывода для последней на текущий момент версии SQL Server 2016 SP1 CU4 (подробнее о версиях и обновлениях SQL Server можно прочитать здесь): Запрос работающий для всех версий SQL Server, начиная с 2000: Расширенная версия со всеми возможными свойствами сервера (взята из замечательных диагностических запросов Glenn Berry), но некоторые параметры доступны только для последних версий SQL Server: Начиная с выпуска SQL Server 2008, можно также использовать отчет об обнаруженных установленных компонентах SQL Server. Этот отчет можно найти на странице Сервис -> Центра установки SQL Server . Это средство отображает сведения обо всех экземплярах SQL Server, установленных в системе. К ним относятся клиентские средства, такие как SQL Server Management Studio. Единственное, о чем необходимо помнить: это средство может выполняться только локально, в системе, в которой установлен экземпляр SQL Server. Его нельзя использовать для получения сведений об удаленных серверах. Подробнее здесь Теперь рассмотрим способы узнать версию для второго варианта когда у вас нет возможности (или прав) подключится к SQL Server:
Если на сервере установлен только один инстанс SQL Server, то -s не нужен: В противном случае необходимо указать название интересующего инстанса, например: SQL: Как определить версию и редакцию SQL сервераЧтобы определить версию Microsoft SQL сервера, используя SQL Server Management Studio, необходимо, правой кнопкой мыши нажать на имени экземпляра и выбрать Properties. Определение версии SQL сервера, используя T-SQLОдин из самых простых и запоминающихся способов, это выполнить простой запрос с использованием глобальной переменной встроенной переменной: Результатом выполнения этого запроса будет строка с информацией о сервере, например, подобная: Определение версии SQL сервера, используя версии файловЕсли есть возможность просмоттреть свойства исполняемого файла sqlservr.exe расположенного в папке: «C:\Program Files\Microsoft SQL Server\MSSQLXX.MSSQLSERVER\MSSQL\Binn\». В свойствах файла на закладке Details отображается текущий установленнный билд, по которому можно определить версию и установленные обновления. Как узнать версию MS SQL ServerДля того, чтобы узнать установленную версию MS SQL Server, надо открыть SQL Management Studio, подключиться к нужному экземпляру сервера, нажать «New Query» и выполнить следующий запрос: Результатом этого запроса будет строка с нужной информацией.
SELECT @@version не выдает информацию об установленном сервис-паке. Уточнить этот момент можно по адресу http://support.microsoft.com/kb/321185/en. Как видите, версия 11.0.5058.0 означает, что установлен второй сервис-пак.
Еще один вариант запроса, позволяющий узнать версию продукта: SELECT SERVERPROPERTY (‘productversion’), SERVERPROPERTY (‘edition’), SERVERPROPERTY (‘productlevel’) В оличие от SELECT @@version функция SERVERPROPERTY возвращает только конкретные свойства, относящиеся к версии, что несколько удобнее.
И для разнообразия еще один, альтернативный способ, не требующий использования Management Studio. В лог-файле Errorlog первые несколько строк содержат информацию о продукте — номер версии, разрядность, редакцию и тип лицензии SQL Server. По умолчанию лог-файлы располагаются в папке Program Files\Microsoft SQL Server\MSSQLx.MSSQLSERVER\MSSQL\log Примечание. Вместо х должен быть номер версии продукта — 12 для SQL Server 2014, 11 для SQL Server 2012, 10 для SQL Server 2008 и т.д.
На этом все. Теперь, если требуется точно выяснить, что за версия SQL Server установлена на сервере, вы знаете что делать. | |

На первой же закладке будет отображаться версия и редакция SQL сервера, а также часть других характеристик.
Однако, такой результат не очень удобен для дальнейшей обработки и структурирования информации. Если необходимо получить информацию о текущих параметрах сервера в структурированном виде и эта информация подлежит дальнейшей обработке, то лучше использовать функцию SERVERPROPERTY. Функция SERVERPROPERTY возвращает сведения о свойствах экземпляра сервера, например, такие параметры как версия, редакция, номер билда, а также характеристики ОС. Подробную информацию о функции SERVERPROPERTY можно посмотреть в документации, на странице: https://docs.microsoft.com/ru-ru/sql/t-sql/functions/serverproperty-transact-sql .




