Cannot set SQL 2005 database to compatability level 80


Hoping someone can help. Due to old compiled code I am not able to amend a SQL query that wont run on SQL 2005+ (its currently working fine on SQL 2000 but the server and SQL needs to go :) )

I need to get compatibility mode to 80;

I've tried the following which returns an error saying the levels are only 90 upwards, any ideas please?


I've tried:

Open in new window

message returned:
Msg 15048, Level 16, State 1, Line 3
Valid values of the database compatability level are 90, 100 or 110

Open in new window

Neil ThompsonSenior Systems DeveloperAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve WalesSenior Database AdministratorCommented:
Since the error message is telling you you can go up to 110, that tells me you're running SQL 2012.

You can't set compatibility level to 80 in SQL 2012, it's just not supported.

See the matrix of what is supported here:

Time to rewrite that code.
Vikas GargAssociate Principal EngineerCommented:

The best practice to change the compatibility level of database is in following three steps.

    Set the database to single user access mode by using
    Change the compatibility level of the database.
    Put the database in multiuser access mode by using

Please note - A database containing an indexed view cannot be changed to a compatibility level lower than 80.

----SQL Server 2005 database compatible level to SQL Server 2000
EXEC sp_dbcmptlevel AdventureWorks, 80;
Neil ThompsonSenior Systems DeveloperAuthor Commented:
Thanks Guys,

Database is definitely 2005
SQL About
I've tried Vikas's code but still get this:
IT Pros Agree: AI and Machine Learning Key

We’d all like to think our company’s data is well protected, but when you ask IT professionals they admit the data probably is not as safe as it could be.

Steve WalesSenior Database AdministratorCommented:
What that is showing is that your TOOLS are 2005.  Doesn't necessarily mean that the database is.   I just tried that internally.  Connected to a 2008R2 DB using tools for SQL 2005.   Help/About showed 2005, but this query below returned 10.50.2550 - showing that I used 2005 SSMS to connect to 2008 R2 database.

Execute this query:  select @@VERSION;

What do you get back ?

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Neil ThompsonSenior Systems DeveloperAuthor Commented:
Thanks Steve,  2012 :(

User error, we were connecting via the 2005 server to a 2012 version, rather than the same server's 2005 copy

Stupid mistake, caught by your question.

Neil ThompsonSenior Systems DeveloperAuthor Commented:
Great comments, thanks for the "how to", and the "why it wasn't working" ideas
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server 2005

From novice to tech pro — start learning today.