Sql-server – SQL Server 2008 compatibility with SQL Server 2005

sql-serversql-server-2005sql-server-2008

What is the best way to use SQL Server 2008 as a development database, but ensure that the database is compatible with SQL Server 2005?

Best Solution

This can be done via SQL Enterprise Manager or like this:

ALTER DATABASE <database> 
SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }

Use 90 for 2005 compatibility.

This replaces the functionality used for previous releases, the stored procedure sp_dbcmptlevel.