Avatar of isames
isames
 asked on

SQL Compatiblity Mode

I was trying to write a Pivot query. I got an error message that said something like "I may  need to go up to a higher "Compatibility Level."

In the Database Properties, I saw where I could change the Compatibility Level to SQL Server 2005(90). Right now it's on SQL Server 2000(80).

I'm on a SQL 2008 box.

Would it cause a problem if I raise the level?
Microsoft SQL Server 2008Microsoft SQL Server

Avatar of undefined
Last Comment
DcpKing

8/22/2022 - Mon
SStory

"Before you change the compatibility level of a database, you should understand the impact of the change on your applications. For more information, see ALTER DATABASE Compatibility Level (Transact-SQL)."
source: https://msdn.microsoft.com/en-us/library/bb933794.aspx

"Use compatibility level as an interim migration aid to work around version differences in the behaviors that are controlled by the relevant compatibility-level setting. "
https://msdn.microsoft.com/en-us/library/bb510680.aspx

Since, per Microsoft it is a temporary stop gap type measure until you can migrate to newer compatibility. I'd not do it while the db has anything going on, backup the db before starting, test it somewhere and be ready to modify any applications that may break. That's just from what I've read...not personal experience with it.
ASKER CERTIFIED SOLUTION
Vitor Montalvão

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Jason clark

When database compatibility is set to previous version and they are attempted with procedure of newer version they will throw the Compatibility Level error. you need to change the Compatibility Level. Read this article to understand the affects of Compatibility Level on database
DcpKing

In addition to Andrew Jackson's good article that Jason Clark points you to above, please note that there were quite a few "breaking changes" when moving from SQL Server 2000 to 2005. There's a pretty comprehensive listing here. You should also see this page. There should also be an equivalent one for 2005 -> 2008
One example that comes to mind in particular is that it can be common to use a small query to provide a list for a combo-box: from 2005 it is not possible to use an order by clause within a sub-query, which broke a lot of code where I worked at the time.

Hope this helps

Mike
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy