我知道这个问题可能会重演。但我遇到的问题是不同的。我已经创建了没有数据的表“CRM_Doctor_Budget”。
我想从excel文件中插入此表中的数据。
我正在使用导入和导出数据(32位)。
按照步骤执行:
我得到的错误:
- Validating (Error)
Messages
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Id".
(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: "component "Destination - CRM_Doctor_Budget" (59)" 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)
我在转换varchar,int,smallint,位数据类型时遇到错误。因为excel文件具有所有数据的通用数据类型。在我已经创建的表中,我有varchar,int,float,smallint和bit。
选中“启用标识插入”后,我得到的错误更少,但错误如下:
Copying to [dbo].[CRM_Doctor_Budget] (Error)
Messages
Error 0xc0202009: Data Flow Task 1: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Unspecified error".
(SQL Server Import and Export Wizard)
Error 0xc020901c: Data Flow Task 1: There was an error with input column "Id" (143) on input "Destination Input" (72). The column status returned was: "The value violated the integrity constraints for the column.".
(SQL Server Import and Export Wizard)
Error 0xc0209029: Data Flow Task 1: SSIS Error Code DTS_E_INDUCEDTRANSFORMFAILUREONERROR. The "input "Destination Input" (72)" failed because error code 0xC020907D occurred, and the error row disposition on "input "Destination Input" (72)" specifies failure on error. An error occurred on the specified object of the specified component. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
Error 0xc0047022: Data Flow Task 1: SSIS Error Code DTS_E_PROCESSINPUTFAILED. The ProcessInput method on component "Destination - CRM_Doctor_Budget" (59) failed with error code 0xC0209029 while processing input "Destination Input" (72). The identified component returned an error from the ProcessInput method. The error is specific to the component, but the error is fatal and will cause the Data Flow task to stop running. There may be error messages posted before this with more information about the failure.
(SQL Server Import and Export Wizard)
答案 0 :(得分:2)
我已经解决了这个问题。我做了一些改变,如:
在编辑映射中:由于我将ID作为标识列,因此它是自动生成的列。
如前所述,我已映射了Id列。
现在这次我没有映射ID列并取消选中“启用我身份插入”
否则我按原样执行步骤..我做了这个小改动,并成功导入记录。 :)谢谢大家的帮助。
答案 1 :(得分:1)
ID列是标识列吗?因为如果是,您需要单击“启用标识插入”复选框以使其生效。