简体   繁体   English

具有多个Insert语句的SQL Compact错误80040E14

[英]SQL Compact Error 80040E14 with multiple Insert statement

I'm trying to execute this query on an SQL Compact DB with the SQL Lite Toolbox for Visual Studio 2015. 我正在尝试使用Visual Studio 2015的SQL Lite工具箱在SQL Compact DB上执行此查询。

INSERT INTO [RadiatorRegistries] ([Brand], [Series], [Model], [Height], [Width], [Depth], [Whellbase], [Capacity], [Surface], [Q50], [Exp], [Typology], [Material], [Kc1], [Kc2], [KcR]) VALUES (N'Aermec', N'Climafon', N'33', 675, 1000, 140, 0, CAST(0.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2)), 2001, CAST(1.30 AS Decimal(18, 2)), N'Termoconvettore', N'Alluminio', CAST(1.00 AS Decimal(18, 2)), CAST(1.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2)))
INSERT INTO [RadiatorRegistries] ([Brand], [Series], [Model], [Height], [Width], [Depth], [Whellbase], [Capacity], [Surface], [Q50], [Exp], [Typology], [Material], [Kc1], [Kc2], [KcR]) VALUES (N'Aermec', N'Climafon', N'41', 675, 1200, 140, 0, CAST(0.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2)), 1810, CAST(1.30 AS Decimal(18, 2)), N'Termoconvettore', N'Alluminio', CAST(1.00 AS Decimal(18, 2)), CAST(1.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2)))

The returned error is: 返回的错误是:

[ Token line number = 2,Token line offset = 1,Token in error = INSERT ]
Error Code: 80040E14

If I remove the second line the INSERT is working fine, the problem is that I've to insert about 2500 rows and I can't manually do that. 如果我删除第二行,则INSERT可以正常工作,问题是我必须插入约2500行,而我不能手动执行此操作。 I've also already tried to add a semicolon at the end of each row. 我也已经尝试在每行的末尾添加一个分号。

Any suggestion? 有什么建议吗?

Seperate each line with a GO: 用GO分隔每行:

INSERT INTO [RadiatorRegistries] ([Brand],
GO
INSERT INTO [RadiatorRegistries] ([Brand],
GO

One method is to use insert . . . select 一种方法是使用insert . . . select insert . . . select insert . . . select with union all : union all insert . . . select

INSERT INTO [RadiatorRegistries]([Brand], [Series], [Model], [Height], [Width], [Depth], [Whellbase], [Capacity], [Surface], [Q50], [Exp], [Typology], [Material], [Kc1], [Kc2], [KcR]) 
    SELECT N'Aermec', N'Climafon', N'33', 675, 1000, 140, 0, CAST(0.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2)), 2001, CAST(1.30 AS Decimal(18, 2)), N'Termoconvettore', N'Alluminio', CAST(1.00 AS Decimal(18, 2)), CAST(1.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2))
    UNION ALL
    SELECT N'Aermec', N'Climafon', N'41', 675, 1200, 140, 0, CAST(0.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2)), 1810, CAST(1.30 AS Decimal(18, 2)), N'Termoconvettore', N'Alluminio', CAST(1.00 AS Decimal(18, 2)), CAST(1.00 AS Decimal(18, 2)), CAST(0.00 AS Decimal(18, 2))

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server错误'80040e14'列名不明确 - SQL Server error '80040e14' Ambiguous column name SQL Server的Microsoft OLE DB提供程序错误'80040e14'无效的列名。 SQL查询 - Microsoft OLE DB Provider for SQL Server error '80040e14' Invalid column name . SQL query SQL Server错误“ 80040e14”,语法错误在“ ORDER”附近 - SQL Server error '80040e14' with syntax error nearby “ORDER” 尝试从 SQL Server 检索数据时出现 VBA ADODB 错误 (80040e14) - VBA ADODB error (80040e14) when trying to retrieve data from SQL Server 如何解决此ASP错误“ 80040e14”? - How can I solve this ASP error '80040e14'? 错误:Ms 访问 VBA 代码中的 2147217900(80040e14) - error: 2147217900(80040e14) in Ms access VBA code ODB错误80040e14 ASP CLASSIC - ODB ERROR 80040e14 ASP CLASSIC VBA中SQL查询表达式中的运行时错误'-2147217900(80040e14)'语法错误(缺少运算符) - Run-time error '-2147217900 (80040e14)' sytax error (missing operatory) in SQL query expression in VBA 经典ASP Microsoft SQL Server本机客户端11.0错误'80040e14'用户登录失败,但不是我指定的用户登录 - Classic ASP Microsoft SQL Server Native Client 11.0 error '80040e14' Login failed for user, but not the one I specified 运行时错误'-2147217900(80040e14)':自动化错误 - Run-time error '-2147217900 (80040e14)': Automation error
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM