Results 1 to 7 of 7
  1. #1
    Join Date
    Dec 2006
    Posts
    8

    Unanswered: is there a GetTick in T SQL?

    is there a GetTick in T SQL?

  2. #2
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    no. there is getdate() however, which has resolution down to 3ms.

  3. #3
    Join Date
    Dec 2006
    Posts
    8
    Quote Originally Posted by jezemine
    no. there is getdate() however, which has resolution down to 3ms.

    can i do a datediff on a ms

  4. #4
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    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

  5. #5
    Join Date
    Nov 2006
    Location
    UK
    Posts
    46
    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

    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)
    Regards
    Kris Zywczyk

  6. #6
    Join Date
    Nov 2002
    Location
    Jersey
    Posts
    10,322
    Quote Originally Posted by SoftwareSoftware
    is there a GetTick in T SQL?

    What is GetTick?

    And why don't you tell us what you are trying to accomplish?
    Brett
    8-)

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

  7. #7
    Join Date
    Nov 2006
    Location
    UK
    Posts
    46
    I think our friend is Java programmer, who must do something in this awful TSQL


    Have a good weekend
    Regards
    Kris Zywczyk

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •