From: John Bell on 26 Feb 2010 14:29 On Fri, 26 Feb 2010 10:36:06 -0800 (PST), JimLad <jamesdbirch(a)yahoo.co.uk> wrote: >Hi, > >SQL Server 2005/2008. Is the following correct (apologies for trivial >example)? > >SELECT -member_id AS member_id >FROM members m >ORDER BY member_id >--Orders by column alias > >SELECT -member_id AS member_id >FROM members m >ORDER BY m.member_id >--Orders by column value > >In SQL Server 2000, both the above seem to order by column alias. Is >this correct? Am I right in thinking that when I upgrade I must go >through my code and remove all the table aliases, otherwise I >potentially get a different sort order? > >Cheers, > >James Hi James In general the upgrade advisor does a lot of this for you, and I would see what it says as the first pass, as there could be other things you need to change. In this instance it looks like SQL 2005 has tightened up the syntax and will give you what you actually specified, so if you need something different you should change the queries. John
|
Pages: 1 Prev: problem slow queries after installing sp4 on sql 2000 Next: Sacramento, CA SQL Server group |