March 4, 2009 at 2:57 am
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.
March 4, 2009 at 5:41 am
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."
March 4, 2009 at 5:58 am
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.
March 4, 2009 at 9:25 am
maybe Upgrade Advisor tool would have caught that ? Not sure
March 4, 2009 at 9:27 am
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
March 4, 2009 at 1:35 pm
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
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- 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
March 5, 2009 at 12:01 am
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.)
March 5, 2009 at 12:38 am
Thank you for the feedback.
Johan
Learn to play, play to learn !
Dont drive faster than your guardian angel can fly ...
but keeping both feet on the ground wont get you anywhere :w00t:
- How to post Performance Problems
- How to post data/code to get the best help[/url]
- 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
Viewing 9 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply