Reputation: 27
How can I convert a hexadecimal timestamp to date time in SQL server. I tried Cast/Convert but it throws error.
Regards, Rahul
Upvotes: 0
Views: 647
Reputation: 15150
You can't. "The Transact-SQL timestamp data type is different from the timestamp data type defined in the SQL-2003 standard. The SQL-2003 timestamp data type is equivalent to the Transact-SQL datetime data type." and "The timestamp data type is just an incrementing number and does not preserve a date or a time. To record a date or time, use a datetime data type." Source
And also: "The timestamp syntax is deprecated. This feature will be removed in a future version of Microsoft SQL Server. Avoid using this feature in new development work, and plan to modify applications that currently use this feature." Source
Upvotes: 2