GeeCON Prague 2014*
The moose likes JDBC and the fly likes timestamp or datetime, which one is more efficent for comparsion? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "timestamp or datetime, which one is more efficent for comparsion?" Watch "timestamp or datetime, which one is more efficent for comparsion?" New topic
Author

timestamp or datetime, which one is more efficent for comparsion?

raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reading my post
can you please let me know which one of timestamp or datetime is more efficent and portable?
We need to store timestamp of an event in database so we can use one of timestamp or date time, which one is more efficent?
which is faster in comparsion and easier to port to other databases?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Are we talking about SQL Server here?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
raminaa niilian
Ranch Hand

Joined: Jul 14, 2005
Posts: 551
Hi
Thank you for reply.
Yes i am using sqlserver

Thanks
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

In which case datetime and timestamp represent very different things. The most important difference is that timestamps in SQL Server are not used to store dates and times. They store binary numbers used in row versioning. If you need a datatype to store a date time value, use datetime.
 
GeeCON Prague 2014
 
subject: timestamp or datetime, which one is more efficent for comparsion?