How do I tell my SQL Server version?

×

The following queries will let you know the version that is installed:

SELECT @@VERSION

SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')

http://support.microsoft.com/kb/321185

 

While this query will tell you the compatibility level each database is running in:

SELECT Name,compatibility_level FROM sys.databases

  • 140 - SQL Server 2017
  • 130 - SQL Server 2016
  • 120 - SQL Server 2014
  • 110 - SQL Server 2012
  • 100 - SQL Server 2008
  • 90 - SQL Server 2005
  • 80 - SQL Server 2000

To increase the compatibility level of a specific database, run the following query:

ALTER DATABASE {database name} SET COMPATIBILITY_LEVEL = {compatibility level from above table}