Monday, March 26, 2012

is there a GetTick in T SQL?

is there a GetTick in T SQL?no. there is getdate() however, which has resolution down to 3ms.|||no. there is getdate() however, which has resolution down to 3ms.

can i do a datediff on a ms|||not sure what you mean. you can get the difference between two dates in units of ms. is that what you mean?

that is: select datediff(ms, '2006-01-01 00:00:01', '2006-01-01 00:00:02.333')

see: http://msdn2.microsoft.com/en-us/library/ms189794.aspx|||Date and time data from January 1, 1753, to December 31, 9999, with an accuracy of one three-hundredth second, or 3.33 milliseconds. Values are rounded to increments of .000, .003, or .007 milliseconds.

You can test following code

declare @.Date1 datetime
declare @.Date2 datetime

set @.Date1 = getdate()
waitfor delay '00:00:00:300'
set @.Date2 = getdate()

select Date1 = @.Date1,
Date2 = @.Date2,
[DateDiff] = datediff(millisecond, @.Date1, @.Date2)|||is there a GetTick in T SQL?

What is GetTick?

And why don't you tell us what you are trying to accomplish?|||I think our friend is Java programmer, who must do something in this awful TSQL ;)

Have a good weekend
:beer:sql

No comments:

Post a Comment