Viewing 15 posts - 1,186 through 1,200 (of 4,081 total)
There is nothing wrong with using a function in a stored proc nowadays. However, there have always been issues with substituting subqueries with scalar functions that included...
April 28, 2011 at 10:59 am
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,...
April 27, 2011 at 11:56 am
Why is dynamic SQL not an option here?
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',...
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...
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...
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)
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. 🙂
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?
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...
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...
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...
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. ...
March 10, 2011 at 1:29 pm
Congratulations, Paul. It's a good read.
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...
February 21, 2011 at 4:07 pm
Viewing 15 posts - 1,186 through 1,200 (of 4,081 total)