Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column

前端 未结 2 769
再見小時候
再見小時候 2020-12-13 05:39

I am using SQL Server 2008 import and export wizard. I need to import a database. I opened the SQL server import/export wizard and I went through the following actions:-

相关标签:
2条回答
  • 2020-12-13 05:51

    With all due respect to Kishore's answer, that approach is valid if you're modifying the packages. Since you're using the import/export wizard, the more straight forward approach would be to check the Enable Identity Insert box on the Column Mappings tab.

    In the Import Export Wizard, after selecting the table for copy, click the Edit Mappings... button

    enter image description here

    In the resulting screen, click the Enable identity insert property and your identities will be replicated over.

    enter image description here

    Same net result as issuing SET IDENTITY_INSERT TableName ON & OFF but this is done automagically at build time.

    0 讨论(0)
  • 2020-12-13 06:15

    Before Importing date execute the below query to set identity insert on:

    SET IDENTITY_INSERT TableName ON
    

    Then do the import operations.

    After importing date execute the below query to set identity insert off:

    SET IDENTITY_INSERT TableName OFF
    
    0 讨论(0)
提交回复
热议问题