Posted  by 

Check Ms Sql Server Version

To check the version and edition of Microsoft® SQL Server on a machine: Press Windows Key + S. Enter SQL Server Configuration Manager in the Search box and press Enter.

  1. Apr 19, 2017  By following this path –%programfiles%Microsoft SQL Server90DTSBinn you will find the required file. By right-clicking on the Properties, you can select the Version tab and view the number. By right-clicking on the Properties, you can select the Version tab and view the number.
  2. Aug 27, 2017  Hi ISTIAK AHMED, How can i check SQL server license which I installed in my Computer. But there is no guarantee and you might have to modify the code to match your SQL Server version. how can i know this is genuine or fake. You might have to contact your local Microsoft office regarding such issue. If you have any other questions.
  3. Start the SQL Server Enterprise Manager application (go to Start, Programs, Microsoft SQL Server, and click Enterprise Manager), right-click the SQL server, select Properties, then select the General tab to view the product version number, as this figure shows. See also, 'Inventory SQL Server Versions on.
Active6 months ago

What are the possible ways to determine the deployed SQL Server version?

I’ve tried to do it using the SQL Server software. I want to do it using a command line SQL statement.

dakab
3,6598 gold badges30 silver badges49 bronze badges
Yameen BashirYameen Bashir

5 Answers

Following are possible ways to see the version:

Method 1: Connect to the instance of SQL Server, and then run the following query:

An example of the output of this query is as follows:

Method 2: Connect to the server by using Object Explorer in SQL Server Management Studio. After Object Explorer is connected, it will show the version information in parentheses, together with the user name that is used to connect to the specific instance of SQL Server.

Method 3: Look at the first few lines of the Errorlog file for that instance. By default, the error log is located at Program FilesMicrosoft SQL ServerMSSQL.nMSSQLLOGERRORLOG and ERRORLOG.n files. The entries may resemble the following:

As you can see, this entry gives all the necessary information about the product, such as version, product level, 64-bit versus 32-bit, the edition of SQL Server, and the OS version on which SQL Server is running.

Method 4: Connect to the instance of SQL Server, and then run the following query:

Note This query works with any instance of SQL Server 2000 or of a later version

OGHaza
4,5686 gold badges19 silver badges28 bronze badges
ImranImran
3,7682 gold badges16 silver badges39 bronze badges

Gives 8.00, 9.00, 10.00 and 10.50 for SQL 2000, 2005, 2008 and 2008R2 respectively.

Also, Try the system extended procedure xp_msver. You can call this stored procedure like

Lingasamy SakthivelLingasamy Sakthivel
8,4739 gold badges45 silver badges86 bronze badges

TL;DR

How To Check Ms Sql Server Version

This uses SQLCMD (comes with SQL Server) to connect to the local server instance using Windows auth, throw an error if a version check fails and return the @@ERROR as the command line ERRORLEVEL if >= 16 (and the second line goes to the :ExitFail label if the aforementioned ERRORLEVEL is >= 1).

Watchas, Gotchas & More Info

For SQL 2000+ you can use the SERVERPROPERTY to determine a lot of this info.

While SQL 2008+ supports the ProductMajorVersion & ProductMinorVersion properties, ProductVersion has been around since 2000 (remembering that if a property is not supported the function returns NULL).

If you are interested in earlier versions you can use the PARSENAME function to split the ProductVersion (remembering the 'parts' are numbered right to left i.e. PARSENAME('a.b.c', 1) returns c).

Also remember that PARSENAME('a.b.c', 4) returns NULL, because SQL 2005 and earlier only used 3 parts in the version number!

So for SQL 2008+ you can simply use:

Cricket - A Bat & Ball Game - Cricket is a team sport that is played outdoors. Cricket originated in England and gradually became popular across the globe. This sport requires complete physi. Bat ball cricket games. Cricket is a free sports game where you have to hit a ball with a bat. Usually cricket is a game played between two teams, but this time it's a 1 player challenge. In this online cricket game you get to train your skills as a batsman. Hit the balls thrown towards your as well as you can and score points. Cricket Games. Cricket World Cup 2011 plays: 879074. Stick Cricket plays: 457741. Hit And Run plays: 428510. Super Sixers 2 plays: 353829. The Dominator Cup plays: 326148. World Cricket plays: 309570. Top Spinner Cricket plays: 285071. Ashes 2 Ashes Cricket plays: 190350. Flash Cricket 2 plays.

For SQL 2000-2005 you can use:

(the PARSENAME(..,0) is a hack to improve readability)

So a check for a SQL 2000+ version would be:

This is a lot simpler if you're only only interested in SQL 2008+ because SERVERPROPERTY('ProductMajorVersion') returns NULL for earlier versions, so you can use:

How To Check Database Version Sql

And you can use the ProductLevel and Edition (or EngineEdition) properties to determine RTM / SPn / CTPn and Dev / Std / Ent / etc respectively.

FYI the major SQL version numbers are:

  • 8 = SQL 2000
  • 9 = SQL 2005
  • 10 = SQL 2008 (and 10.5 = SQL 2008R2)
  • 11 = SQL 2012
  • 12 = SQL 2014
  • 13 = SQL 2016
  • 14 = SQL 2017

And this all works for SQL Azure too!

EDITED:You may also want to check your DB compatibility level since it could be set to a lower compatibility.

AndrewDAndrewD
R.AlonsoR.Alonso

Here is what i have done to find the version:just write SELECT @@version and it will give you the version.

Imad UllahImad Ullah

Query To Check Microsoft Sql Server Version

Not the answer you're looking for? Browse other questions tagged sql-server-2008version or ask your own question.