more granularity than getdate()

Hi EEE<
 Is there a function on the SQL server that provides more granularity than the getdate(). I am finding that at times the getdate() creates 2 same timestamps.
Thanx
LuckyLucksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Kevin HillSr. SQL Server DBACommented:
you are getting two identical timestamps all the way down to the millisecond?  Wow...

I am not aware of anything more granular.....perhaps another Expert is...
0
LuckyLucksAuthor Commented:
yes, something like 2005-03-15 11:59:12.770
0
Anthony PerkinsCommented:
Yes, that will happen when you udpate or insert multiple rows.  They will all have the same value.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Scott PletcherSenior DBACommented:
No, AFAIK, Windows cannot provide anything more granular then 3 (not 1) milliseconds, so neither can SQL Server.  Therefore, if you need uniqueness, you will also need to use an identity column or something similar.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Anthony PerkinsCommented:
Scott,

>>No, AFAIK, Windows cannot provide anything more granular then 3 (not 1) milliseconds<<
I know this is beside the point, but should that not be 18 ticks per second or approximately 55 milliseconds?
0
Scott PletcherSenior DBACommented:
I know that SQL is only accurate to within 3ms.  This can be confirmed from BOL and simple tests.

What I read -- I think it was from the "Inside SQL Server" books, but not 100% sure now -- indicated that was because Windows itself cannot handle time with accuracy below 3ms.  The cause of that, you're right, had something to do with cycles and clock ticks, but I don't remember all those details.  [Please forgive me, I'm a software guy *not* a hardware guy.]
0
Anthony PerkinsCommented:
>>I know that SQL is only accurate to within 3ms.<<
Right, BOL confirms this:
<quote>
Date and time data from January 1, 1753 through December 31, 9999, to an accuracy of one three-hundredth of a second (equivalent to 3.33 milliseconds or 0.00333 seconds)
</quote>
I just don't understand how that is possible if Windows itself cannot handle a resolution finer than 55 milliseconds.

>>[Please forgive me, I'm a software guy *not* a hardware guy.]<<
Same here that is why I though I would ask you. <g>

Thanks all the same.
0
Scott PletcherSenior DBACommented:
>> I just don't understand how that is possible if Windows itself cannot handle a resolution finer than 55 milliseconds. <<

As *I* understand it, Windows can now also handle down to 3ms, but I could easily be mistaken.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.