April 24, 2007 at 12:00 pm
I have the following problem,
some tables have timestamp datatype.
I would like to copy data to another database but with same structure.
The problem is the timestamp, that is the only column different from equivalent tables between different database.
Is it possible to disable timestamp to have same data after insert and update.
Thank
April 24, 2007 at 3:29 pm
It does not make any sense.
Timestamp does not hold any useful information, so there is no point to copy it across.
Only point of timestamp column - is to indicate if the row was changed since you have read it last time.
So, it does not matter which value is in it, only changes of it do matter.
_____________
Code for TallyGenerator
April 25, 2007 at 4:06 am
Thank for your reply,
I know that timestamp is used only to know if a rw is update, in fact timestamp is the only data not inserted/update (autogenerated by sql server), but the problem is that:
data exported to other db (destination) must be update as well before to delete data on the source db.
The only way to verify that data (source db) can be deleted is to verify that all data on these equivalent tables on both databases are syncronized (to avoid missing data).
Otherwise I have to check column by column (I would like to avoid this).
Or if possible ? to convert timestamp in another datatype and re-converted to timestamp for data comparison.
April 25, 2007 at 4:39 am
How do you "verify that all data on these equivalent tables on both databases are syncronized (to avoid missing data)"?
_____________
Code for TallyGenerator
April 25, 2007 at 7:21 am
If at the moment there is not solution about timestamp,
as written, delete operation (joining equivalent tables) will be prerformed comparing col by col between equivalent tables (apart timestamp col).
April 25, 2007 at 8:20 am
TIMESTAMP is just a BINARY(8) value. If you do not need the funtionality of Timestamp in the second database, create the columns as BINARY(8) instead of TIMESTAMP. You can then insert the value of the timestamp into the binary(8) column and use it for your comparisons.
Brian
April 26, 2007 at 1:05 am
Thank to all,
I have already thought about changing datatype to binary(8) but at the moment the column should maintain the same datatype.
April 26, 2007 at 7:09 am
Hello,
Is it possible to alter a timestamp column to binary(8)?, because doing it by TSQL is not possible, but I am able to alter the column by Enterprise Manager
Thank
April 26, 2007 at 7:26 am
and how to insert timestamp data into binary field. With right conversion
Thank
April 26, 2007 at 7:33 am
If you do it in EM, I believe it actually creates a new table, copies the data to it, drops the original, and then renames the new table and creates any indexes and keys that were on the original table. You can run Profiler to see for sure. Since timestamp is a binary field, you don't need to do any conversion to load it into a binary field.
Brian
April 26, 2007 at 1:26 pm
Hi tried to load data into a binary field, but values terminates with some 0 "zeros".
How can I delete this "zeros" into the field or prevent this.
thank
April 26, 2007 at 2:09 pm
I have found out a strange behaviour, on sql server 2005 inserting timestamp on binary(8) data is correct, on SQL server 2000 the values has zeros at the end.
April 26, 2007 at 2:25 pm
If you would open BOL you could find this in there:
A nonnullable timestamp column is semantically equivalent to a binary(8) column. A nullable timestamp column is semantically equivalent to a varbinary(8) column.
_____________
Code for TallyGenerator
May 2, 2007 at 1:45 pm
Thank
for your contribution
Viewing 14 posts - 1 through 13 (of 13 total)
You must be logged in to reply to this topic. Login to reply