我在 OLEDB 命令转换中使用以下 SQL 语句。
语法 1:
INSERT INTO dbo.Table1 (col1,col2)
SELECT ?, 22 FROM dbo.Table1
但是,它失败并出现错误:
语法错误、权限违规或其他非特定错误。
但是,这种语法可以正常工作。
语法 2:
INSERT INTO dbo.Table1 (col1,col2)
values (?,?)
SSIS 不支持语法 1 吗?
我在 OLEDB 命令转换中使用以下 SQL 语句。
语法 1:
INSERT INTO dbo.Table1 (col1,col2)
SELECT ?, 22 FROM dbo.Table1
但是,它失败并出现错误:
语法错误、权限违规或其他非特定错误。
但是,这种语法可以正常工作。
语法 2:
INSERT INTO dbo.Table1 (col1,col2)
values (?,?)
SSIS 不支持语法 1 吗?
There's a hack to make it work & Martina White (http://dataqueen.unlimitedviz.com/) helped me out with it.
Below is her transcript:
I can duplicate your issue. There is a funky issue with OLE DB Command. When I write the query with the Values statement commented out, the Syntax 1 query as you have written it does work. When I remove the commented out statement it does not work. It seems to want the word Values() in there, regardless of whether it is commented out.
Try this and see if you get the same behaviour. If so, this should work successfully for you.
INSERT INTO dbo.Table1 (col1,col2)
--Values()
SELECT ?, 22 FROM dbo.Table1
不它不是; 事实上,我所知道的任何数据库都不支持它。您不能参数化 SELECT 语句的列。