How to compare non-nullable Timestamp with Binary(8)
Hilty
Posts: 2 New member
We have two almost identical databases. We have fields called row_version on a number of tables. In one database they are non-nullable Timestamp fields and in the other database they are non-nullable binary(8).
When I try to compare the two SQL Data Compare tells me the Timestamp and binary(8) fields can't be compared because they are incompatible data types.
You can't put a specific value in a timestamp field so I need to be able to copy the timestamp from one database and write the same value into the other database which is why we use binary(8)...but then I have the problem when comparing.
I also have the same problem if I use varbinary.
Is there a datatype that I can write to that can be compared to a timestamp field?
Thanks
When I try to compare the two SQL Data Compare tells me the Timestamp and binary(8) fields can't be compared because they are incompatible data types.
You can't put a specific value in a timestamp field so I need to be able to copy the timestamp from one database and write the same value into the other database which is why we use binary(8)...but then I have the problem when comparing.
I also have the same problem if I use varbinary.
Is there a datatype that I can write to that can be compared to a timestamp field?
Thanks
Tagged:
Answers
Hi and thanks for your post!
I'm sorry to say that SQL Data Compare can only compare timestamp columns to other timestamp columns.
Please see here for the types which can be compared: https://documentation.red-gate.com/sdc14/troubleshooting/unexpected-behavior-technical-questions/which-data-types-can-be-compared
So sorry as I know this is not the answer you were hoping for!
Jessica Ramos | Product Support Engineer | Redgate Software
Have you visited our Help Center?