Archive for the ‘SQL’ Category

SQL Compatibility levels

Thursday, July 30th, 2009

Version of SQL Server database can be one of the following:

  • 60 = SQL Server 6.0
  • 65 = SQL Server 6.5
  • 70 = SQL Server 7.0
  • 80 = SQL Server 2000
  • 90 = SQL Server 2005

The sp_dbcmptlevel stored procedure affects behaviors only for the specified database, not for the entire server. sp_dbcmptlevel provides only partial backward compatibility with earlier versions of SQL Server. A database containing an indexed view cannot be changed to a compatibility level lower than 80.

sp_dbcmptlevel
Sets certain database behaviors to be compatible with the specified version of SQL Server.

Example:
—-SQL Server 2005 database compatible level to SQL Server 2000
EXEC sp_dbcmptlevel SampleDB, 80;
GO
—-SQL Server 2000 database compatible level to SQL Server 2005
EXEC sp_dbcmptlevel SampleDB, 90;
GO

VN:F [1.1.7_509]
Rating: 0.0/10 (0 votes cast)