Viewing 15 posts - 58,501 through 58,515 (of 59,091 total)
It's easy with a Tally (or Numbers) table...
--===== This is just part of the test setup...
--===== If experimental tables exists, drop them
IF OBJECT_ID('TempDB..#yourtable') IS NOT NULL
DROP...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 15, 2006 at 9:12 am
Is is "death by SQL" to change the Server Wide Setting but if you insist on a certain proc being able to evaluate IF NULL=NULL, then you can use SET...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 15, 2006 at 8:55 am
Outstanding Gail... I forgot about the batchsize thing... to take that a bit further, I used BCP for a similar requirement with 40 million rows... Using a batch size of...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 13, 2006 at 6:37 am
The SELECT/INTO works very fast because the new destination table has no indexes to update and no check constraints.
If you add the WITH (NOLOCK) hint to the FROM clause,...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 12, 2006 at 9:33 pm
You say 'em, I'll make 'em. What a team!
The neat thing here is that using NEWID as the seed for RAND allows true...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 11, 2006 at 11:22 pm
Here's a set-based method...
SELECT CHAR(RAND(CAST (NEWID() AS VARBINARY))*26+65)
+ CHAR(RAND(CAST (NEWID() AS VARBINARY))*26+65)
+ CHAR(RAND(CAST (NEWID() AS VARBINARY))*26+65)
+ CHAR(RAND(CAST (NEWID() AS VARBINARY))*26+65)
+ CHAR(RAND(CAST (NEWID() AS VARBINARY))*26+65)
+ CHAR(RAND(CAST (NEWID()...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 11, 2006 at 9:16 pm
Yeaup! That's the one!! You were there, too, Jesper... way too much fun!
--Jeff Moden
Change is inevitable... Change for the better is not.
January 11, 2006 at 9:01 pm
Here's one that absolutely rocks! I don't remember the person who wrote it originally, but the two of us played with it and it generates a list on a million...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2006 at 5:54 pm
We call it the "Easy button"... ![]()
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2006 at 5:48 pm
Thanks Carlos! Comments like yours make it all worth while! ![]()
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2006 at 5:44 pm
There's a couple hundred different ways of doing this... here's one...
--For NANPA numbers only...
CREATE TABLE #example (ID INT IDENTITY(1,1), PhoneNum VARCHAR(15))
INSERT INTO #example (PhoneNum)
SELECT '2223334444' UNION...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 10, 2006 at 5:37 pm
Nicely done...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 9, 2006 at 7:22 am
Maybe, but the use of the "double parameter" isn't really going to slow anything down here... I am confused by your posting, though... you say "giving me the first Monday"......
--Jeff Moden
Change is inevitable... Change for the better is not.
January 8, 2006 at 8:16 am
Easy...
1. Any decimal dollar amount greater than x.xx5, regardless of the number of decimal places, will be rounded up to the penny.
2. Any decimal dollar amount less than x.xx5, regardless...
--Jeff Moden
Change is inevitable... Change for the better is not.
January 6, 2006 at 12:15 am
Dang... Your name is even posted right under your handle, too! I missed that... sorry, Gail.
--Jeff Moden
Change is inevitable... Change for the better is not.
January 5, 2006 at 6:10 am
Viewing 15 posts - 58,501 through 58,515 (of 59,091 total)