Drop Table
Support Forum for database administrators and web based access to important newsgroups related to databasesI noticed that some queries work in 2000, but not in 2005, for example SELECT columnA, columnB, case when columnC = 'BLAH' then dbo.fn_func(columnD) sum(columnE) FROM TableA GROUP BY columnA, columnB, case when columnC = 'BLAH' then dbo.fn_func(columnD) Works for 2K, but for 2K5 i get an error message saying "columnD is invalid in the select list because it is not contained...etc etc" ANyone know of the change?
Post Follow-up to this messageIt shouldn't work on SQL2000 either. Your CASE expression is not complete an d there should be a comma before sum(columnE). The following should work on both versions: SELECT columnA, columnB, case when columnC = 'BLAH' then dbo.fn_func(columnD) end, sum(columnE) FROM TableA GROUP BY columnA, columnB, case when columnC = 'BLAH' then dbo.fn_func(columnD) end Linchi "adauti@gmail.com" wrote: > I noticed that some queries work in 2000, but not in 2005, for example > > > SELECT columnA, > columnB, > case when columnC = 'BLAH' then dbo.fn_func(columnD) > sum(columnE) > FROM TableA > GROUP BY > columnA, > columnB, > case when columnC = 'BLAH' then dbo.fn_func(columnD) > > Works for 2K, but for 2K5 i get an error message saying "columnD is > invalid in the select list because it is not contained...etc etc" > > ANyone know of the change? > >
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread