gpt4 book ai didi

sql-server-2008 - 在sql server 2008中导入excel文件

转载 作者:行者123 更新时间:2023-12-03 01:55:20 24 4
gpt4 key购买 nike

我知道这个问题可能会重复。但我对此的看法有所不同。我已经创建了没有数据的表“CRM_Doctor_Budget”。

Table Created in sql server 2008

我想将 Excel 文件中的数据插入到该表中。

我正在使用导入和导出数据(32 位)。

我执行以下步骤:

First step

Second step

third step

5th step

6th step

7th Step

8th step

我收到的错误:

- 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、bit 数据类型时遇到错误。因为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)

最佳答案

我已经解决了这个问题。我做了一些更改,例如:

在编辑映射中:因为我有 ID 作为身份列,并且它是自动生成的列。

如前所述,我已经映射了 Id 列。

现在,这次我没有映射 ID 列,也没有取消选中“启用 I 身份插入”

否则我按原样执行步骤..我已经完成了这个小更改,并且成功导入了记录。 :) 谢谢大家的帮助。

关于sql-server-2008 - 在sql server 2008中导入excel文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15249957/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com