Viewing 15 posts - 58,276 through 58,290 (of 59,048 total)
...and thank you for the feedback...
April 18, 2006 at 8:43 pm
Or... don't let it default to INT...
declare @DateOfInterest datetime,
@EpochDate datetime
set @DateOfInterest = '12/11/1962'
set @EpochDate = '1/1/1970 03:00'
select CAST((@DateOfInterest - @EpochDate) AS DECIMAL(24)) *24 *60 *60 *1000 as n
April 17, 2006 at 9:38 pm
Short, simple, nasty fast because there are no VARCHAR conversions...
SELECT DATEADD(mm,DATEDIFF(mm,0,GETDATE()),0)-1
April 17, 2006 at 9:29 pm
I agree... I always spell them out all the way...
I don't believe BOL calls them "alias names" though.
April 17, 2006 at 9:26 pm
The scripts offered will certainly work (although you may want to add WHERE so.XTYPE = 'U' to filter on tables only), but tell me please... why would you want to...
April 16, 2006 at 9:14 pm
Not quite true... JOIN is an acceptable shortcut for INNER JOIN. Additionally, LEFT JOIN, RIGHT JOIN, and FULL JOIN are acceptable shortcuts for the similarly named OUTER counterparts...
USE Northwind
SELECT...
April 16, 2006 at 9:03 pm
Ben,
Why not make the ConsultancyBookingNumber column in the Consultancy table and IDENTITY column instead of using MAX+1? Then, you wouldn't even need this procedure as the column would be auto-numbering...
April 16, 2006 at 8:44 pm
Nicely done... You should publish this in the "scripts" section of this forum.
April 16, 2006 at 8:33 pm
Although the DATEADD/DATEDIFF method will sometimes return a faster duration, it is slower than "convert(datetime,convert(int,GetDate()-.5))" if you consider actual resources used like CPU Seconds and DIsk Reads and Writes. Here's...
April 15, 2006 at 11:13 pm
I just can't bring myself to trust anything in an article where the author makes mistakes like the following...
"Remember that the BETWEEN clause retrieves values that are equal...
April 15, 2006 at 10:22 pm
David wrote... "If I was to use the static table approach I would probably stick it in its own database so that it wouldn't artificially inflate the backups."
Yep, I know...
April 14, 2006 at 6:19 pm
Thank you for the very nice compliment... I only hope it does what you need ![]()
April 14, 2006 at 6:12 pm
Well done, David. It's nice to see it when someone takes multiple methods and does a really good performance comparison.
It seems that generating a range of numbers in a temporary...
April 13, 2006 at 10:49 pm
...and thank you for the feedback...
By the way, if you do put such an index on the table, you will never have duplicates again.
April 13, 2006 at 6:23 pm
I only count 2 extra rows but that may be due to a simple lack of coffee... ![]()
Anyway... I think this might be what...
April 13, 2006 at 6:20 pm
Viewing 15 posts - 58,276 through 58,290 (of 59,048 total)