If you want to use SQL Server Operators Operators like PIVOT, UNPIVOT, NTILE, and CTE's you'll probaly recieve follwoing error message:

"Incorrect syntax near 'PIVOT'. You may need to set the compatibility level of the current database to a higher value to enable this feature. See help for the stored procedure sp_dbcmptlevel. (.Net SqlClient Data Provider)" You have to set your database to 90 compatibility to use the SQL 2005 operators like PIVOT, UNPIVOT, NTILE, and CTE's.  To do this you just need to execute the following statement:

EXEC dbo.sp_dbcmptlevel @dbname=N'DatabaseName', @new_cmptlevel=90

Just change the databasename to match your database.
Tags
Comments
Write the first comment
Leave a trace
Name *
Email *
Website
Anti SPAM * Code (7 + 3) =
Leave me a comment *
 
All comments are subject to editorial review
Post being viewed right now
Item date: 16.06.2009
Views: 1686
Item date: 22.08.2009
Views: 1415
Item date: 09.03.2009
Views: 1165
Item date: 15.05.2009
Views: 1576
Item date: 04.02.2009
Views: 793
Item date: 19.07.2009
Views: 685
Item date: 23.12.2010
Views: 1134
Item date: 24.08.2009
Views: 401
Item date: 19.07.2009
Views: 1450
Item date: 23.08.2009
Views: 2129