+ Reply to Thread
Results 1 to 5 of 5

Alter database compatibility_level

  1. Alter database compatibility_level

    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 }


  2. Re: Alter database compatibility_level

    Hi

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




    vinu
    http://oneplace4sql.blogspot.com/



    "PaulN" wrote in message
    news:95F06DCA-0F25-49D9-805C-3787C58EE633@microsoft.com...
    >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 }
    >




  3. Re: Alter database compatibility_level

    You were reading books online for 2008. Prior to that, you need to use sp_dbcmptlevel, as suggested
    by vinu.

    --
    Tibor Karaszi, SQL Server MVP
    http://www.karaszi.com/sqlserver/default.asp
    http://sqlblog.com/blogs/tibor_karaszi


    "PaulN" wrote in message
    news:95F06DCA-0F25-49D9-805C-3787C58EE633@microsoft.com...
    >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 }
    >



  4. Re: Alter database compatibility_level

    Like, totally embarrassed...

    "Tibor Karaszi" wrote:

    > You were reading books online for 2008. Prior to that, you need to use sp_dbcmptlevel, as suggested
    > by vinu.
    >
    > --
    > Tibor Karaszi, SQL Server MVP
    > http://www.karaszi.com/sqlserver/default.asp
    > http://sqlblog.com/blogs/tibor_karaszi
    >
    >
    > "PaulN" wrote in message
    > news:95F06DCA-0F25-49D9-805C-3787C58EE633@microsoft.com...
    > >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 }
    > >

    >
    >


  5. Re: Alter database compatibility_level

    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). :-)

    --
    Tibor Karaszi, SQL Server MVP
    http://www.karaszi.com/sqlserver/default.asp
    http://sqlblog.com/blogs/tibor_karaszi


    "PaulN" wrote in message
    newsB9C92D3-42C6-459E-905A-0A29048439ED@microsoft.com...
    > Like, totally embarrassed...
    >
    > "Tibor Karaszi" wrote:
    >
    >> You were reading books online for 2008. Prior to that, you need to use sp_dbcmptlevel, as
    >> suggested
    >> by vinu.
    >>
    >> --
    >> Tibor Karaszi, SQL Server MVP
    >> http://www.karaszi.com/sqlserver/default.asp
    >> http://sqlblog.com/blogs/tibor_karaszi
    >>
    >>
    >> "PaulN" wrote in message
    >> news:95F06DCA-0F25-49D9-805C-3787C58EE633@microsoft.com...
    >> >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 }
    >> >

    >>
    >>



+ Reply to Thread