I need a select from table which does not have column that tells when row was inserted, only timestamp
column (values like: 0x0000000000530278). Some data was i
I know it is too late but might help someone else.
Timestamp/RowVersion can be casted to BigInt but in any mean it cannot be compared to datetime.
Following statement is taken from MSDN
The Transact-SQL rowversion data type is not a date or time data type. timestamp is a deprecated synonym for rowversion.
For more detail refer here
To identify new rows by timestamp you need to keep track of the timestamps that were there beforehand. In a pinch you could:
With a minor risk of false positives if anything else has been going on in the DB this will get you a reasonably good difference.
For a more robust check you could calculate MD5 or SHA-1 hashes with Hashbytes on the row contents to give you a difference with a very low probability of collision (see this wikipedia article on Birthday attacks for a discussion of this problem).