Sunday, February 26, 2012

Error using /SET

I have a data importing .dtsx file that I would like to point towards another server on occasion. I tried:

DTEXEC /FILE "fubar.dtsx" /SET "\Package.Connections[ConnectionManagerName].Properties[ConnectionString];Data Source=NEWSVR;Initial Catalog=Fubar;Provider=SQLNCLI;Integrated Security=SSPI;Auto Translate=False;" /MAXCONCURRENT " -1 " /CHECKPOINTING OFF /REPORTING EWCDI

but I keep getting the error:

Argument ""\Package.Connections[ConnectionManagerName].Properties[ConnectionString];Data Source=NEWSVR;Initial Catalog=Fubar;Provider=SQLNCLI;Integrated Security=SSPI;Auto Translate=False;"" for option "set" is not valid.

Staring at the XML within the .dtsx file gave me no insight other than I suspect the "ConnectionManagerName" is the problem. How do I figure out the magic incantation? It's definitely not as trivial as using '-S NEWSVR' on SQLCMD!
You need to put double quotes around the connection string, first of all.

You also might want to try using the /CONN switch instead. Search this forum for examples.

No comments:

Post a Comment