2013-10-11 1 views
1

J'utilise l'instruction SQL ci-dessous dans une transformation de commande OLEDB.SSIS OleDBCommand Transformations - syntaxe prise en charge

Syntaxe 1:

INSERT INTO dbo.Table1 (col1,col2) 
SELECT ?, 22 FROM dbo.Table1 

Mais, il échoue avec une erreur:

syntax error , permission violation or other nonspecific error.

Cependant, cette syntaxe fonctionne très bien.

Syntaxe 2:

INSERT INTO dbo.Table1 (col1,col2) 
values (?,?) 

SYNTAX 1 pas pris en charge par SSIS?

Répondre

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 
+0

Ceci est absolument ridicule. Mais travaille. – Valuk

0

Non, ce n'est pas le cas; en fait, ce n'est pas pris en charge par une base de données dont je suis au courant. Vous ne pouvez pas paramétrer les colonnes d'une instruction SELECT.

Questions connexes