Values ​​in the timeline field displayed in hexadecimal format (0x000000000000000866) In Microsoft SQL Server 2008

I have a table in which I save emails that were sent. Then I decided to add the TimeStamp field to this table so that I could track when the email was sent. The data is written to the table without any problems, but when I go to view the contents of the table using Microsoft SQL Server 2008 Management Studio, the data contained in the Timestamp field is displayed as follows: 0x000000000000000000845, even in the recorded records to the database, since timestamp value entered

Then I changed the field type to datetime, and then displayed the date. But, for example, it displays the date 1900-01-01 00:00:23. Then I changed it back to the Timestamp field and it returned to it in the current hexadecimal format.

Am I doing something wrong?

Greetings

+8
database sql-server
source share
1 answer

Then I decided to add a TimeStamp field for this table so that I can track when an email was sent

Oh yes. Reading the database would show you that the TMIestamp field, which is a legacy of the Sybase server, does not store a timestamp. Basically this is something like a global operation counter. It has nothing to do with time.

If you need a real timestamp, enter a column of the DateTime type and set the system time as default / via the trigger, etc. The timestamp is completely unacceptable for this.

Again, there is no MS stuff β€” MS SQL Server ran as a Sybase SQL Server port for Windows, and the Timestampdata type is a legacy of Sybase.

+14
source share

Source: https://habr.com/ru/post/649981/


All Articles