Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column(错误 0xc0202049:数据流任务 1:插入只读列失败)
问题描述
我正在使用 SQL Server 2008 导入和导出向导.我需要导入一个数据库.我打开了 SQL 服务器导入/导出向导,并完成了以下操作:-
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:-
对于目的地,我选择了SQL server native client 10".
for the destination I chose "SQL server native client 10".
然后我从一个或多个表或视图中选择了复制数据.
then I selected copy data from one or more tables or view.
SSIS 立即运行
但我收到以下错误,
操作停止...
初始化数据流任务(成功)
Initializing Data Flow Task (Success)
初始化连接(成功)
设置 SQL 命令(成功)
Setting SQL Command (Success)
设置源连接(成功)
设置目标连接(成功)
正在验证(错误)
消息错误 0xc0202049:数据流任务 1:插入失败只读列ActionID".(SQL Server 导入和导出巫师)
Messages Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "ActionID". (SQL Server Import and Export Wizard)
错误 0xc0202045:数据流任务 1:列元数据验证失败.(SQL Server 导入导出向导)
Error 0xc0202045: Data Flow Task 1: Column metadata validation failed. (SQL Server Import and Export Wizard)
错误 0xc004706b:数据流任务 1:组件"目的地 -AuditActions" (22)" 验证失败并返回验证状态VS_ISBROKEN".(SQL Server 导入导出向导)
Error 0xc004706b: Data Flow Task 1: "component "Destination - AuditActions" (22)" failed validation and returned validation status "VS_ISBROKEN". (SQL Server Import and Export Wizard)
似乎我无法导入标识列和时间戳列,那么如何强制导入这些值?
It seems that I can not import identity columns and timestamps columns, so how I can force these values to be imported?
推荐答案
在导入日期之前执行以下查询以设置身份插入:
Before Importing date execute the below query to set identity insert on:
SET IDENTITY_INSERT TableName ON
然后进行导入操作.
导入日期后执行以下查询以关闭身份插入:
After importing date execute the below query to set identity insert off:
SET IDENTITY_INSERT TableName OFF
这篇关于错误 0xc0202049:数据流任务 1:插入只读列失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:错误 0xc0202049:数据流任务 1:插入只读列失败


基础教程推荐
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 带更新的 sqlite CTE 2022-01-01
- 带有WHERE子句的LAG()函数 2022-01-01