Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

TIME/DATE Datatypes Accuracy. Expand / Collapse
Author
Message
Posted Sunday, January 27, 2013 11:18 PM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 2:42 AM
Points: 415, Visits: 1,588
Hi all,

What is the meaning of "Accuracy of 100 nonseconds" in case TIME data type in sql server 2008.
And for every date/time data type there is an Accuracy constraint what does it means?

Thanks.


Post #1412189
Posted Monday, January 28, 2013 12:41 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 2:25 AM
Points: 2,658, Visits: 4,733
A nanosecond (ns) is one billionth of a second (10−9 or 1/1,000,000,000 s)...( From Wikipedia http://en.wikipedia.org/wiki/Nanosecond )

As an example, a variable with data type TIME may store a data like 08:31:50.0000005 which means the time now is 08 Hours, 31 Minutes, 50 Seconds and 500 NanoSeconds

Similarly, I hope you can understand the meaning of other accuracy constraints for TIME/DATE data types.



Kingston Dhasian

How to post data/code on a forum to get the best help - Jeff Moden
http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1412213
Posted Monday, January 28, 2013 1:45 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 2:42 AM
Points: 415, Visits: 1,588
Kingston Dhasian (1/28/2013)
A nanosecond (ns) is one billionth of a second (10−9 or 1/1,000,000,000 s)...( From Wikipedia http://en.wikipedia.org/wiki/Nanosecond )

As an example, a variable with data type TIME may store a data like 08:31:50.0000005 which means the time now is 08 Hours, 31 Minutes, 50 Seconds and 500 NanoSeconds

Similarly, I hope you can understand the meaning of other accuracy constraints for TIME/DATE data types.


Thanks for ur reply,

But can u say it in words, in the above example 5*100 is the nanoseconds?

Like that if accuracy is 1 day, ex: 28th, jan, 2013, then 28*1 = 28...so on


Post #1412237
Posted Monday, January 28, 2013 10:23 PM


SSC-Insane

SSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-InsaneSSC-Insane

Group: General Forum Members
Last Login: Today @ 8:49 AM
Points: 20,682, Visits: 32,281
It means the time reported is accurate to 100 nanoseconds. You won't get any time values less than that reported.

If you need more information you may want to try looking up the TIME datatype in the SQL Server Books Online. It should be able to provide you with additional information.



Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Post #1412759
Posted Tuesday, January 29, 2013 2:03 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 2:42 AM
Points: 415, Visits: 1,588
Lynn Pettis (1/28/2013)
It means the time reported is accurate to 100 nanoseconds. You won't get any time values less than that reported.

If you need more information you may want to try looking up the TIME datatype in the SQL Server Books Online. It should be able to provide you with additional information.


Thanks for ur replay,
But i'm not able to catch the exact point of "Accuracy", and i have looked into the MSDN but there is also no such information on.

please clarify me.


Post #1412820
Posted Tuesday, January 29, 2013 2:15 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Today @ 2:10 AM
Points: 5,216, Visits: 5,108
Are you familiar with fractions of time?

10th of a second
100th of a second
1000th of a second

etc.

Well a nano second is 1 billionth of a second.

So time is actuate to 100 billionth's of a second




Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1 & Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger

Post #1412824
Posted Tuesday, January 29, 2013 3:00 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 2:42 AM
Points: 415, Visits: 1,588
anthony.green (1/29/2013)
Are you familiar with fractions of time?

10th of a second
100th of a second
1000th of a second

etc.

Well a nano second is 1 billionth of a second.

So time is actuate to 100 billionth's of a second


Now i got clear picture, as follows:

1sec = 10^9 nanoseconds

But in sql server the time's precession is 10^7, so 10^9 - 10^7 = 10^2 (100 is the part of the nanoseconds). For example as one of our author mentioned in this chain 12.12.34.0000005 this is 000000500 (500) nanosecond. I believe it is correct.




Post #1412848
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse