Viewing 15 posts - 10,156 through 10,170 (of 14,953 total)
If you're talking about having a variable list of column names as an input parameter, you'll have to use dynamic SQL for that.
One thing I'll recommend is parse the string,...
April 3, 2009 at 9:06 am
T-SQL is clunky in certain regards. For example, why doesn't this work:
select Col1, count(*)
from dbo.MyTable;
SQL Server will raise an error that Col1 is neither contained in a Group By...
April 3, 2009 at 8:06 am
If you change the right outer join to a full outer join, and play around with the Where clause a little bit, you'll get both extra columns, and missing columns,...
April 3, 2009 at 7:54 am
Don't let it scare you. I've been doing this kind of thing for a long time.
Definitely a good idea to work out how it does what it does. ...
April 3, 2009 at 7:36 am
You have to save each section of the execution plan. All you got in the zip file was the first piece of the query.
April 3, 2009 at 7:32 am
This solution isn't quite as performant as Chris', but it also isn't dependent on the max value being 9, which that one seems to assume.
;with CTE (CTEID, Seq1, Seq2) as
(select...
April 3, 2009 at 7:06 am
This whole thing is quite obviously just a riddle. I'm just waiting for the next set of examples, which will have something like:
Col1 Col2
1 ...
April 3, 2009 at 6:50 am
No, it is the same as the 3, null, 9, situation, mathematically. A later value in a later column is higher than an earlier value in an earlier column.
As...
April 2, 2009 at 3:30 pm
Bob Hovious (4/2/2009)
April 2, 2009 at 1:37 pm
Nope. Won't work on that one. That's the equivalent of the 3,null,9 case. Col4 of row 4 is lower than Col3 of row 3. (Col5 and...
April 2, 2009 at 1:28 pm
Insert the XML into a temp table, then compare tempdb.sys.columns to sys.columns in the database where the permanent table is, filtering by object_id in both cases of course. A...
April 2, 2009 at 1:14 pm
As a side note, my solution also solves andrewd.smith's samples correctly.
The only ones it failes on are ones that we've been told are impossible, as per my earlier posts. (3,0,9...
April 2, 2009 at 1:05 pm
Sir, I will bow to your obviously superior knowledge of all things in all universes. But, the results from the first sample were correct. Here are the results...
April 2, 2009 at 12:59 pm
Viewing 15 posts - 10,156 through 10,170 (of 14,953 total)