Viewing 15 posts - 57,361 through 57,375 (of 59,101 total)
Sorry... took a bit more than 10 minutes because of all the demo code I added but here's my suggestion... I used all temp tables so you could play without having...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 9:39 pm
Gimme ten minutes... I'll be right back...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 8:58 pm
One more question... Is it possible to add a single column to the table?
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 8:53 pm
Ok... this takes 2 seconds longer (1,000,000 rows in 23 seconds instead of 21)... had to work around the "zero domain" on the LOG10 function to get this to work...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 6:57 pm
There would certainly appear to be a fly in the ointment
... thanks for the catch and sorry for the mistake folks... I'll see...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 5:41 pm
I'm thinking it just might be something else because the following works just fine and without any error...
select datediff( hh, 'May 17 2002 9:53', 'May 18 2002 9:53')
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 5:19 pm
Don't worry, Gail... we considered the source ![]()
![]()
![]()
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 5:12 pm
| ...but when doing that I must maintain the sequence of un-duplicated numbers |
Commando...
I think the quote above explains it...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2006 at 5:06 pm
A good ol' batch file that uses OSQL or BCP would be easy enough... and, then, the user could provide whatever filename they wanted as a parameter.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 8:04 pm
Choose wisely and carefully... you get one clustered index per table. And, just because you have a clustered index on a table does not guarantee it will be used... you...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 8:00 pm
If the naming differences are that bad, generate scripts for all the views from EnterPrise Manger, drop all the views, recreate the views using the script.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 7:56 pm
This should do it... don't worry about the couple of strings you see... this is still pretty darned fast and they make it independent of the @@DATEFIRST setting... (you can...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 6:16 pm
Sorry... had posted a solution here (and deleted it) for hours that didn't take into account days that were on the weekends... I'll be right back with the correction.... 
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 6:05 pm
This will give you whole days... modify the "ends" of the range to do hours... also, not affected by @@DATEFIRST settings... very fast... very simple...
SELECT (DATEDIFF(dd,@StartDate,@EndDate)+1)
-(DATEDIFF(wk,@StartDate,@EndDate)*2)
...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 5:38 pm
Also, have you looked into using sp_AddLinkedServer... it, in fact, supports links to DB2. See Books Online,
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2006 at 4:13 pm
Viewing 15 posts - 57,361 through 57,375 (of 59,101 total)