September 2, 2011

Change compatibility level of database in SQL Server

If we try to write left outer join query with *= operator in SQL Server 2005 or 2008
it will raise an exception in SQL Server.Because it is supported in SQL Server 2000.
You cannot directly write this in SQL Server 2005 or 2008.
For writing this in SQL Server 2005 or 2008 we need to change compatibility level of
database.

ALTER DATABASE <DBName>
SET COMPATIBILITY_LEVEL = 80

80   = SQL Server 2000
90   = SQL Server 2005
100 = SQL Server 2008

That’s it
Enjoy Learning.

No comments:

Post a Comment