Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Datetime column with milliseconds???

Author  Topic 

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-03-27 : 07:47:39
hi ppls..
we have sql server 2000 EM. we received daily xml files and we insert into our database.there is one column Date_T having data type datetime.till date we recieved this records from xml as '03/23/2004 12:23:34:956' but due to some duplicate isssue we now want to modified this column to recieve as milliseconds like '03/23/2004 12:23:34:956232' now my point is wheather sql server handle this kind of milliseconds..please help me out as early as possible..

T.I.A

Papillon

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-27 : 07:49:43
from BOL
quote:
datetime

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). Values are rounded to increments of .000, .003, or .007 seconds, as shown in the table.




KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-03-27 : 07:59:19
hi..KH..

means there is no point to implement my new modification (millisecods date format)????

T.I.A

Papillon
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-27 : 07:59:27
Also read this article fully
http://www.windowsitpro.com/Articles/Print.cfm?ArticleID=15574

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-27 : 08:05:53
quote:
Originally posted by under2811

hi..KH..

means there is no point to implement my new modification (millisecods date format)????

T.I.A

Papillon


datetime accuracy is only 3.33 milliseconds. Do you really required to keep up to that details ?



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-03-27 : 08:08:34
hi KH...

yes we need that much length of detail to avoid our duplicate issues...

T.I.A

Papillon
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-27 : 08:12:58
can you use an identity column as the primary key ?



KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-03-27 : 08:20:12
hi..

actually we have other pks.we inserting records into database from PKs and max(Date_T)..sometimes we are getting records having same PKS and also same Date_T e.g. PK is 23 and Date_T '03/23/2004 12:23:34:956' and another records like PK is 23 and Date_T '03/23/2004 12:23:34:956' so there is problem with duplicate issue...so we need more length of milliseconds means PK is 23 and Date_T '03/23/2004 12:23:34:956457' and another record is PK is 23 and Date_T '03/23/2004 12:23:34:956897' ....

T.I.A
Papillon

Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-03-27 : 08:24:37
maybe you can store up to seconds in the Date_T column and store the milliseconds in a separate integer column ?

record 1 : Date_T = '03/23/2004 12:23:34:000' Date_MS = 956457
record 2 : Date_T = '03/23/2004 12:23:34:000' Date_MS = 956897




KH

Choice is an illusion, created between those with power, and those without.
Concordantly, while your first question may be the most pertinent, you may or may not realize it is also the most irrelevant

Go to Top of Page

under2811
Constraint Violating Yak Guru

366 Posts

Posted - 2006-03-27 : 08:28:30
hi..KH

thank you very much ..means there is no one step way to do that..ok thanks for your valuable time..i will think to add new column...

T.I.A

Papillon
Go to Top of Page
   

- Advertisement -