Viewing 15 posts - 271 through 285 (of 2,171 total)
Am I too late for the party? 😀
SELECTNum,
Chr,
REPLICATE(CHAR(65 + (Num - 1) % 26), 1 + (Num - 1) / 26) AS Peso
FROM(
SELECT1 AS Num, 'A' AS Chr UNION ALL
SELECT2...
April 28, 2010 at 5:54 am
Paul White NZ (4/4/2010)
SwePeso (4/3/2010)
See what happens with pre-1900 dates using FLOAT method...Hmmm...nasty!
Don't blame me. Blame rounding... 😀
April 4, 2010 at 3:33 am
The DATEDIFF/DATEADD is the only reliable way to get accurate results.
See what happens with pre-1900 dates using FLOAT method
DECLARE@Today DATETIME = '1898-12-31 23:00'
SELECTCAST(CONVERT(FLOAT, @Today) AS INT),
DATEDIFF(DAY, 0, @Today)
April 3, 2010 at 1:39 pm
Paul White NZ (4/3/2010)
Carl Federl (4/3/2010)
CAST(convert(int, convert(float, getdate() )) AS DATETIME)
Few of issues with this one.
1. Relies on undocumented internal implementation details.
2. Only works with DATETIME - none...
April 3, 2010 at 1:09 pm
Also asked here
I answered
SELECT CAST(GETDATE() AS DATE)
March 31, 2010 at 4:34 am
GilaMonster (3/28/2010)
I assume you mean 'clustered index', not 'primary key'.
The RID's there on all tables, cluster and heap. It's only used in nonclustered indexes if the underlying table's a heap,...
March 28, 2010 at 10:01 am
karthikeyan-444867 (3/26/2010)
But I didn't see any difference in the execution time.
Please post your COMPLETE table structure, including triggers and keys.
All indexes too, please.
Then post your execution plan in "sqlplan" xml...
March 28, 2010 at 6:28 am
Paul White NZ (3/28/2010)
Well, technically there is, sort of, but it is undocumented and not intended for use by end users.
+1 for that.
All records do have a "hidden" record identifier,...
March 28, 2010 at 6:22 am
The good Lord allows you to jump in, huh Jeff? 😀
March 27, 2010 at 2:42 pm
Short and simple
SELECTABS(CHECKSUM(NEWID())) % 1000000000
March 26, 2010 at 5:51 pm
Jeffrey Williams-493691 (3/26/2010)
I like it - nice solution.
Thank you.
Now when I read the code, I see that the "/ 2" is not even necessary...
March 26, 2010 at 4:20 pm
DECLARE@Sample TABLE
(
MarkPer CHAR(2),
StartDate DATETIME,
EndDate DATETIME
)
SET DATEFORMAT MDY
INSERT@Sample
SELECT'M1', '07/24/2009', '10/02/2009' UNION ALL
SELECT'M2', '10/20/2009', '12/18/2009' UNION ALL
SELECT'M3', '01/04/2010', '03/12/2010' UNION ALL
SELECT'M4', '03/29/2010', '05/28/2010' UNION ALL
SELECT'S1', '07/24/2009', '01/04/2010' UNION ALL
SELECT'S2', '01/05/2010', '05/28/2010'
DECLARE@Today DATETIME
SET@Today...
March 26, 2010 at 4:07 pm
Are you sure, Jeff?
If you filter for the nullable/unique column
CREATE UNIQUE NONCLUSTERED INDEX UX_Table1 ON Table1 (Col1)
WHERE Col1 IS NOT NULL
You can have how many NULL's you want, but as...
March 22, 2010 at 12:48 am
david.c.holley (3/19/2010)
March 21, 2010 at 3:24 pm
Carlo Romagnano (2/19/2010)
February 19, 2010 at 6:42 am
Viewing 15 posts - 271 through 285 (of 2,171 total)