Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Upgrading compatibility level is not backwards compatible? Expand / Collapse
Author
Message
Posted Wednesday, March 4, 2009 2:57 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 17, 2009 5:20 AM
Points: 2, Visits: 8
Hi,

recently i changed the compatibility level of my database from 80 to 90. This broke one of my stored procedures. Changing it a little bit made it ok again.

But what worries me, is that their could be more of these breaking changes, is there a list somwhere of the differences of those compatibility levels?

This was the query (parts of it):

....
SELECT distinct top 100 m.matnr,isnull(pr.price,0) as price,m.oemcode,m.prodcd,m.materialgroup,m.eurocode,m.img_exists, p.description,isnull(s.rankcode,9999) as rankcode,
...
order by S.rankcode, p.description, m.matnr
...

Removing the S. in s.rankcode made it work. I understand why. But i don't understand why it worked in an older compatibility level. (removing the DISTICT made it work also, but with a different result->also strange behaviour)

Thanks for tour time.

Post #667968
Posted Wednesday, March 4, 2009 5:41 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Monday, July 21, 2014 2:56 AM
Points: 2,603, Visits: 2,061
While you change the compatibility level of my database from 80 to 90. It's always good to test each and every Stored procedures, function, triggers, Buisness rules etc. in your test environment.

Also it's quite obvious that after the comopatibility level change your some of the SP may not work hence Microsoft also recommend to test it in test environment thoroughly.

HTH


---------------------------------------------------
"Thare are only 10 types of people in the world:
Those who understand binary, and those who don't."
Post #668053
Posted Wednesday, March 4, 2009 5:58 AM
Old Hand

Old HandOld HandOld HandOld HandOld HandOld HandOld HandOld Hand

Group: General Forum Members
Last Login: Friday, October 15, 2010 8:23 AM
Points: 371, Visits: 437
In 80 compatibility when you have alias for derived column that is same as column name, the prefix is ignored in the order by statement and the order is done on the derived column. In 90 it is not ignored and the order is done on the table column first

Check out "Alter Database Compatibility Level" in BOL. It has differences between 80, 90 and 100.
Post #668070
Posted Wednesday, March 4, 2009 9:25 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 7:48 PM
Points: 2,834, Visits: 8,542
maybe Upgrade Advisor tool would have caught that ? Not sure


Post #668395
Posted Wednesday, March 4, 2009 9:27 AM
Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Monday, November 10, 2014 9:36 AM
Points: 1,414, Visits: 4,544
we had something similar during testing

devs had queries that said

select column1, column1, column3 from sometable order by column1

worked in 80 but not in 90


https://plus.google.com/100125998302068852885/posts?hl=en
http://twitter.com/alent1234
x-box live gamertag: i am null
[url=http://live.xbox.com/en-US/MyXbox/Profile[/url]
Post #668400
Posted Wednesday, March 4, 2009 1:29 PM
SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 6:34 AM
Points: 6,259, Visits: 2,031
It is actually expected to have different behaviors when changing compatibility levels!
It is all well documented HERE



* Noel
Post #668638
Posted Wednesday, March 4, 2009 1:35 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:42 AM
Points: 6,743, Visits: 8,515
p.description,isnull(s.rankcode,9999) as rankcode,
...
order by S.rankcode, p.description, m.matnr
...

Removing the S. in s.rankcode made it work. I understand why. But i don't understand why it


I would suspect the collation in stead of the dblevel.
I notice you've used a capital S and a non-capital s to be used as the columns alias.

Replace the s.rankcode to S.rankcode, and give a little feedback if that has been the issue.

If you would have posted the from-part, that plausibility might be confirmed.


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #668646
Posted Thursday, March 5, 2009 12:01 AM


Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, March 17, 2009 5:20 AM
Points: 2, Visits: 8
THANKS for your time, the correct answer came from noeld : he gave a link to a list with the differences between the compatibility levels.
(it was not because of the different capitalization, i just wrote that to put the attention on the S.)
Post #668952
Posted Thursday, March 5, 2009 12:38 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 7:42 AM
Points: 6,743, Visits: 8,515
Thank you for the feedback.


Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #668963
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse