Home > Back-end >  I have a SQL table column with this value '0x000000001903A06C'. and the column name is �
I have a SQL table column with this value '0x000000001903A06C'. and the column name is �

Time:09-22

I have a SQL table column with this value '0x000000001903A06C', and the column name is 'mr_timestamp'. Not sure what is the format and how to make this value readable. How can I interpret this value?

CodePudding user response:

I can't be sure without seeing the exact definition for the column, but it looks like this isn't actually a time stamp value as we normally think of time stamps, in spite of the mr_timestamp name. Instead, it looks like a rowversion. Rowversion tracks a relative time to that database column rather than anything associated with a clock. The only things it's useful for is sorting rows by which was changed most (or least) recently.

To help explain the mr_timestamp name, the SQL Server timestamp type is an alias for rowversion. If you really need timestamps, you should use datetime or datetime2 instead.

In other words, what you've shown is already all there is; there's nothing to change that will make the value any more readable.

In fact, the type is actually deprecated, meaning it should no longer be used for new work, and removed from old as the opportunity presents.

  •  Tags:  
  • sql
  • Related