将工作表中的数据导入 SQL 服务器
Importing data from worksheet into SQL Server
我正在尝试将数据从 MS Excel (Pro Plus 2013) 导入到 SQL Server 2014。每次尝试这样做时,我都会收到以下错误。 table 中的列设置为 nvarchar(50)
,而 Excel 中的 none 列的字符数超过 30。我试过一遍又一遍地重新创建 Excel 电子表格,只是为了确保我做的一切都是正确的。我只是无法获取要导入的数据。
这些是我收到的错误:
Validating (Error) Messages:
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_First_Name" with a length of 255 to database column "Agent_First_Name" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Last_Name" with a length of 255 to database column "Agent_Last_Name" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Email" with a length of 255 to database column "Agent_Email" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Extension" with a length of 255 to database column "Agent_Extension" with a length of 4.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Cell_Phone" with a length of 255 to database column "Agent_Cell_Phone" with a length of 10.(SQL Server Import and Export Wizard)
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Agent_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: "Destination - tableAgents" 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)
您似乎正在尝试导入现有 table。我建议先将数据导入新的 table(例如,"tmpAgent"——您可以稍后删除此 table)。允许 SQL 服务器选择导入的 tables 大小,或者您可以在导入的 "Edit mappings" 部分设置大小。
将数据导入新 table 后,创建查询以将其移至您的代理 table。
我遇到了同样的错误信息。
原来我在 excel 文件中有一个流氓合并单元格集群。我取消合并这些单元格,重新尝试导入,我的所有数据都已成功导入到 excel 文件。
我正在尝试将数据从 MS Excel (Pro Plus 2013) 导入到 SQL Server 2014。每次尝试这样做时,我都会收到以下错误。 table 中的列设置为 nvarchar(50)
,而 Excel 中的 none 列的字符数超过 30。我试过一遍又一遍地重新创建 Excel 电子表格,只是为了确保我做的一切都是正确的。我只是无法获取要导入的数据。
这些是我收到的错误:
Validating (Error) Messages:
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_First_Name" with a length of 255 to database column "Agent_First_Name" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Last_Name" with a length of 255 to database column "Agent_Last_Name" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Email" with a length of 255 to database column "Agent_Email" with a length of 50.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Extension" with a length of 255 to database column "Agent_Extension" with a length of 4.(SQL Server Import and Export Wizard)
Warning 0x802092a7: Data Flow Task 1: Truncation may occur due to inserting data from data flow column "Agent_Cell_Phone" with a length of 255 to database column "Agent_Cell_Phone" with a length of 10.(SQL Server Import and Export Wizard)
Error 0xc0202049: Data Flow Task 1: Failure inserting into the read-only column "Agent_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: "Destination - tableAgents" 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)
您似乎正在尝试导入现有 table。我建议先将数据导入新的 table(例如,"tmpAgent"——您可以稍后删除此 table)。允许 SQL 服务器选择导入的 tables 大小,或者您可以在导入的 "Edit mappings" 部分设置大小。
将数据导入新 table 后,创建查询以将其移至您的代理 table。
我遇到了同样的错误信息。
原来我在 excel 文件中有一个流氓合并单元格集群。我取消合并这些单元格,重新尝试导入,我的所有数据都已成功导入到 excel 文件。