I copied this command straight from the books on line and executed it in sql
2005 9.0.3068
ALTER DATABASE AdventureWorks
SET COMPATIBILITY_LEVEL = 90;
GO
And I get this message…
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near '90'.
Any body else get this error? What is the correct syntax?
The manual shows:
ALTER DATABASE database_name
SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }
vinu - 29 Aug 2008 15:56 GMT
Hi
Use sp_dbcmptlevel
EXEC dbo.sp_dbcmptlevel @dbname=N'SQLH2Repository', @new_cmptlevel=90
vinu
http://oneplace4sql.blogspot.com/
>I copied this command straight from the books on line and executed it in
>sql
[quoted text clipped - 11 lines]
> ALTER DATABASE database_name
> SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }
Tibor Karaszi - 29 Aug 2008 18:45 GMT
You were reading books online for 2008. Prior to that, you need to use sp_dbcmptlevel, as suggested
by vinu.

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
>I copied this command straight from the books on line and executed it in sql
> 2005 9.0.3068
[quoted text clipped - 10 lines]
> ALTER DATABASE database_name
> SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }
PaulN - 29 Aug 2008 19:06 GMT
Like, totally embarrassed...
> You were reading books online for 2008. Prior to that, you need to use sp_dbcmptlevel, as suggested
> by vinu.
[quoted text clipped - 13 lines]
> > ALTER DATABASE database_name
> > SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }
Tibor Karaszi - 29 Aug 2008 19:53 GMT
Happens to all of us. I for instance did the very same thing the other day, and it was just
compatibility level I tried (on 2005 using ALTER DATABASE). :-)

Signature
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
> Like, totally embarrassed...
>
[quoted text clipped - 16 lines]
>> > ALTER DATABASE database_name
>> > SET COMPATIBILITY_LEVEL = { 80 | 90 | 100 }