Issue for Inserting Timestamp
If we try to
insert the actual timestamp data from Sybase table to SQL Server, we
are getting error with ‘Cannot insert an
explicit value into a timestamp column. Use INSERT with a column list
to exclude the timestamp column, or insert a DEFAULT into the
timestamp column. Severity 16’.We intent to create same
database copy to SQL Server based on Sybase with all data. But this
above given error stopping the data insertion. I have attached the
screenshot for the direct insertion along with error.
To
avoid the above given error along with data migration, Map timestamp
to binary (8) type for table columns. During SSMA conversion, add a
new column named ssma_timestamp that has a Transact-SQL timestamp
type. Add the default @@DBTS for the old timestamp column to ensure
that this column receives proper timestamp values after the migration
finishes. The ssma_timestamp column is necessary to advance the
@@DBTS value after the row is update. We should change the timestamp
to ssma_timestamp for the required places of procedures, functions,
triggers and other objects. Usually these changes will be in the
select statement of the scripts. Please find the screenshot below
with the required changes.
No comments:
Post a Comment