Difference between datetime and timestamp in sqlserver?

MduSenthil picture MduSenthil · Aug 18, 2011 · Viewed 268.4k times · Source

What is the difference between Timestamp and Datetime SQL Server?

I thought Both formats are capable of storing date + time. Then, Where the difference is lying between them?

But Timestamp is not capable of storing date, time information.

Still Whats the difference?

Answer

Jon Skeet picture Jon Skeet · Aug 18, 2011

According to the documentation, timestamp is a synonym for rowversion - it's automatically generated and guaranteed1 to be unique. datetime isn't - it's just a data type which handles dates and times, and can be client-specified on insert etc.


1 Assuming you use it properly, of course. See comments.