Viewing 15 posts - 1 through 15 (of 43 total)
Good article, but I've been surprised with the use of COALESCE() for getting the 'Grand Total' in Listing 3. I think it's better to use the GROUPING() function to know...
August 22, 2012 at 12:39 am
Nobody seems to care about the maybe remote possibility of having the searched string splitted between two rows of syscomments, if the code is big enough to span over 4000...
January 31, 2012 at 3:49 am
In a few words, the difference between sp & functions is that functions yields an expression and so it can be used in a expression context (in SELECT clause, b.e.),...
April 21, 2011 at 5:51 pm
Dear friends:
I'm a little disappointed after reading the comments of this forum. Few people have liked or commented on the anomalous behavior described, and most, rude apart, are concentrated...
December 29, 2010 at 5:54 am
By the way, my cleaver colleague reminds me we had got this behavior sometimes, when sending SQL code in Lotus Notes emails.
Fortunately, in those cases the behavior led to...
December 23, 2010 at 2:55 am
For those who propose alternative writtings to the sample code, you must consider that code is only a construction to verify the actual behavior of a query.
The original code was...
December 23, 2010 at 2:47 am
I'm sorry for your lost points, guys. If it's a consolation for you, I spent two mornings completely puzzled with this issue, to the point I asked for help in...
December 23, 2010 at 2:28 am
I feel it's easier truncating a CONVERT(..., ..., 121), then CASTing again and adding the unit if the two dates differ - you can easily add a flag for ceiling/truncating:
CREATE...
November 29, 2010 at 8:07 am
Thank you guys. I was obfuscated -- too much time at work --- Now it's clear crystal, but this morning it wasn't. Thanks again,
November 25, 2010 at 11:15 am
More compact query:
[font="Courier New"]DECLARE @TABLE TABLE(
ID INT IDENTITY,
InTime DATETIME,
OutTime DATETIME)
INSERT INTO @TABLE
SELECT '2010-11-09 02:15:00', '2010-11-09 02:45:00'
UNION ALL SELECT '2010-11-09 01:01:00', '2010-11-09 01:45:00'
UNION ALL SELECT '2010-11-08 00:01:00', '2010-11-09 12:45:00'
SELECT id,
Convert(...
November 9, 2010 at 7:39 am
Errata: what is lacking is 0A (line feed, NL , CHAR(10)), not carriage return 0D.
November 9, 2010 at 6:37 am
SQLZ (8/13/2010)
The thing I'd like to pick up on, that drew my attention, was your reasons for moving away from...
August 15, 2010 at 7:29 am
dml_std (8/12/2010)
In fact in all the code I have written I...
August 12, 2010 at 6:23 am
rajn.knit07 (8/11/2010)
Hi,It seems that you are correct when we know the possible values user can input.
But what if the values change in future or new values are added in future.
In...
August 11, 2010 at 11:39 pm
Jay Hopping (8/11/2010)
after further thought, I don't like my suggestion because it doesn't work with differing lengths of items.
I was about to tell you. It operates only on fixed length...
August 11, 2010 at 4:25 pm
Viewing 15 posts - 1 through 15 (of 43 total)