Avatar of APD Toronto
APD Toronto
Flag for Canada asked on

How to Read and Use Timestamp in MSSQL

Hi Experts,

I have MSSQL 2008 R2 database table, which has a timestamp field, but I am wondering how can I read and use this in a WHERE clause?

A sample timestap is
0x0000000000035647

Thank you
Microsoft SQL ServerMicrosoft SQL Server 2008SQL

Avatar of undefined
Last Comment
Scott Pletcher

8/22/2022 - Mon
Scott Pletcher

You can't use it in any meaningful way.  It really doesn't have anything to do with time.  It's just a sequential counter.
APD Toronto

ASKER
I thought it was a date/time of when a record is changed?

If it is a sequential counter, does it update when a record is updated?
Scott Pletcher

SQL Server uses it internally as a unique counter.  That name is confusing -- the new name/data type is "rowversion", which is more accurate.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
APD Toronto

ASKER
So I cannot use to find out which records were recently updated?
ASKER CERTIFIED SOLUTION
Scott Pletcher

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.