Viewing 15 posts - 1,186 through 1,200 (of 4,080 total)
I find it helpful to think of OUTER APPLY as being similar to a LEFT JOIN.
When you use a CROSS APPLY, if the applied function (or query) returns no rows,...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 27, 2011 at 11:56 am
Why is dynamic SQL not an option here?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 25, 2011 at 6:06 am
CREATE TABLE #T1 (cat1 char(1), cat2 char(1),cat3 char(1), cat4 char(1))
CREATE TABLE #T2 (cat1 char(1), cat2 char(1),cat3 char(1), cat4 char(1))
INSERT INTO #T1
SELECT 'A', 'B','C','D' UNION ALL
SELECT 'A', 'B','C','D' UNION ALL
SELECT 'A',...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 22, 2011 at 2:45 pm
DECLARE @date DATE = getdate()
SELECT DATEADD(DAY,7-DATEPART(dw,@date),@date)
Just substitute your date column for @date in the DATEADD function.
The DATEPART() function with the 'dw' parameter returns the day of the week (1-7) for...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
April 22, 2011 at 2:36 pm
BCP is not the tool for importing EXCEL spreadsheets. It works on common text files. However you could save your spreadsheet as a CSV...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 31, 2011 at 5:59 pm
Alvin Ramard (3/29/2011)
CirquedeSQLeil (3/29/2011)
jcrawf02 (3/29/2011)
CirquedeSQLeil (3/29/2011)
jcrawf02 (3/29/2011)
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 29, 2011 at 4:13 pm
Thanks for the reply, Rajesh. Glad that's working for you, even though the function has a (shudder) WHILE loop in it. 🙂
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 29, 2011 at 11:14 am
Three questions:
1) Is there a maximum string length?
2) Is there a maximum number of output elements?
3) Do you want the spaces before and after the <> symbols trimmed?
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 29, 2011 at 9:58 am
This is one of those jobs where I have nothing against a cursor, or a while loop, because you are doing the same operation against multiple TABLES, as opposed to...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 22, 2011 at 6:17 am
CirquedeSQLeil (3/17/2011)
Brandie Tarvin (3/17/2011)
Craig Farrell (3/17/2011)
Annnnd, now I have an image of sheep storming the castle. I wonder if they fit their armor before or after sheerings...
CRAIG!
Stop giving me...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 17, 2011 at 12:42 pm
Grant Fritchey (3/16/2011)
Jeff Moden (3/16/2011)
Craig Farrell (3/16/2011)
GilaMonster (3/16/2011)
I object, I'm a model of good behaviourwell, compared to others on that list anyway...
Isn't that like saying you're a 'nice' barbarian because...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 16, 2011 at 6:54 pm
FULL OUTER JOINS are very useful when comparing two sets of data and you want to identify items that exist in one set but not in another. ...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 10, 2011 at 1:29 pm
Congratulations, Paul. It's a good read.
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
March 5, 2011 at 2:25 pm
I was a little bored, so I'm going to throw a fish...
declare @sample table (class Char(1), value int)
insert into @sample
select 'A',3 union all
select 'A',19 union all
select 'B',8 union all
select 'A',3...
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
February 21, 2011 at 4:07 pm
GSquared (2/21/2011)
jcrawf02 (2/21/2011)
GSquared (2/21/2011)
Jeff Moden (2/21/2011)
__________________________________________________
Against stupidity the gods themselves contend in vain. -- Friedrich Schiller
Stop, children, what's that sound? Everybody look what's going down. -- Stephen Stills
February 21, 2011 at 3:47 pm
Viewing 15 posts - 1,186 through 1,200 (of 4,080 total)