Attempting insertion into the row version column "SSMA_TimeStamp". Cannot insert into a row version column

11k views Asked by At

I am using SQL Server 2012 and trying to import data from one database to another and both the database are on different server.

I make sure that following four action should be performed:

  1. Creating a Database (Via generate scripts)
  2. Creating User (via generate scripts)
  3. Right Click database-> Task ->to export data
  4. Create a Job via SQL Server agent

On the third step, I am stuck. Database has been created, users has been added. I am making sure that identity insert is enabled and even deleted all the data to make sure everything is right.

However, during exporting the data I am getting following error (check this image) :

Validating (Error)
Messages
Error 0xc0202048: Data Flow Task 1: Attempting insertion into the row version column "SSMA_TimeStamp". Cannot insert into a row version column.
(SQL Server Import and Export Wizard)

Error 0xc0202045: Data Flow Task 1: Column metadata validation failed.
(SQL Server Import and Export Wizard)

Error 0xc004706b: Data Flow Task 1: "Destination 1 - tblAccessLevel" failed validation and returned validation status "VS_ISBROKEN".
(SQL Server Import and Export Wizard)

Error 0xc004700c: Data Flow Task 1: One or more component failed validation.
(SQL Server Import and Export Wizard)

Error 0xc0024107: Data Flow Task 1: There were errors during task validation.
(SQL Server Import and Export Wizard)

Not sure, what I am missing. Any help greatly appreciated.

2

There are 2 answers

1
Casey On

Since you've deleted the data, you could go one more step at the Select Source Tables and Views > Edit Mappings - click inside the destination cell for SSMA_TIMESTAMP and choose 'ignore' from the drop down. enter image description here

0
Molloch On

I know this is an old question, but I had a database with 600 tables all with Rowversion and this would have taken forever. This is first answer that comes up in Google.

Instead, I copied the source database to a new database (Detach, copy, reattach), and then ran this to create a series of statements to remove all the rowversion columns:

SELECT      c.name  AS 'ColumnName'
        ,t.name AS 'TableName',
        'ALTER TABLE ' + t.name + ' DROP COLUMN ' + c.name
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.system_type_id = 189
ORDER BY    TableName
        ,ColumnName;

The import/export wizard will now run correct and new rowversions will be created on the new database.