Passing connection string properties when using DTEXEC - ssis

I am wondering what the correct format is for passing connection string properties on the command line when using dtexec:
dtexec.exe /Ser IpAddress\Instance /IS "\SSISDB\Data Warehouse\MyProject\MyPackage.dtsx" /DumpOnError /Set \Package.Variables[DW_ConnectionString].Properties[Value];\""Data Source=IpAddress;Initial Catalog=DWDB;Provider=SQLNCLI10.1;IntegratedSecurity=SSPI;"\"
I have defined the above command line configuration where I am attempting to pass override properties for the default connection string properties. The packages I'm targeting are not using package connections, but instead project level parameters/properties have been defined to store the DB connections.
For some reason I can't get this to work . I am getting an error message on the server saying
Failed to configure an overridden property that has the
following path: \Package.Variables
[DW_ConnectionString].Properties
[Value]. An error occurred while setting the value of
property "Value". The error returned is 0x80020009
Is my format correct for overriding properties?
The packages are hosted on a remote server

Try using DTEXECUI next time to generate your command string. It has places for all of the variables, connection managers etc. All you have to do is bring up your package and it fills everything in. You then enter any changes you want in the GUI then go to the Command line tab and it will give you the string to put after DTEXEC.EXEC. You can of course also run the package from DTEXECUI also.

It turns out that my format was wrong:
It's incorrect to use /Set Package Variable in this context:
The correct format is:
/Par "$Project::DW_ConnectionString";\""Data Source=Server\Instance;Initial Catalog=myDb;Provider=SQLNCLI11.1;Integrated Security=SSPI;AutoTranslate=False;"\"

Related

SSIS 2008 Execute Package Task Connection Expression not valid

In SSIS 2008 I am trying to configure a package to execute another package using the Execute Package Task. In the Execute Package Task Connection expression I am using a variable that contains the absolute path to the folder where the package I want to execute is located because as we all now relative paths don't work in SSIS. The expression evaluates to what looks to be the right path as can be seen in the screenshot below.
However when I try to execute the package I get the following error that it can't find the package:
I am very confused by this because the package path is correct. Any ideas?
I think you are setting the connection in the wrong place.
You need to set the connection string in the connection manager.
Example that I want to change the Package1.dtsx to execute Package2t.dtsx ..
Created Connection Manager "Package1.dtsx" that references a package in a folder called Package1.dtsx
Properties of Connection of Package1.dtsx in Connection Manager
Change ConnectionString in Connection Manager to execute Package2t.dtsx.
Try including double quotes since your file path string has spaces in it
"\"" + #[User::RootFolder] + "\\" + "ImportSessionAndSubsessions.dtsx\""

How to specify DTExec parameter types

The project runs in Visual Studio and when started from the Integration Services Catalog.
When I run it from the command line with a parameter file, both of these lines:
/Par $Project::MaxRows;"250000"
/Par $Project::MaxRun;"45"
Cause this error:
Failed to execute IS server package because of error 0x80131904.
Description: The data type of the input value is not compatible with the data type of the 'Int32'
Source: .Net SqlClient Data Provider
If I take these lines out, the project runs fine with the defaults, which are the same as what is specified.
Any ideas on how to debug this?
UPDATE:
Fixed the issue by changing the types of the parameters to String and casting to int where they are used. But I'm still struggling with the "works when submitted from SSIS but not from command line" thing. I'd like to understand why.
EDIT: Changed the Title to reflect the actual problem.
Try this:
/Par "$Project::MaxRows(Int32)";250000
/Par "$Project::MaxRun(Int32)";45
There are some good examples of working with dtexec here -> http://technet.microsoft.com/en-us/library/hh231187.aspx

Error thrown by SSIS package : The input Web Services Description Language (WSDL) file is not valid

Im trying to connect to a web service using Web Service task. I have used the WsdlFile property to dynamically set the path of WSDL file.
The package executes fine on my local system. When I try to execute the same package on my TEST server ( via Active Batch scheduler), it fails with the following exception :
-1073548540,0x,An error occurred with the following error message: "Microsoft.SqlServer.Dts.Tasks.WebServiceTask.WebserviceTaskException: The input Web Services Description Language (WSDL) file is not valid.
I have placed the WSDL file in my TEST server location ( which is equal to the path set in WsdlFile property) and also have Delay Validation = True on WebService task in the package.
Kindly help on how can I resolve this issue.
In my experience this will only occur if the WSDL file is invalid (obviously!) or the SSIS package can't find the WSDL file. Ensure that your configuration exposes the WsdlFile property.
To do so, select SSIS > Package Configurations, and create or edit an existing configuration. Tick the WsdlFile property to expose it:
This will add a property to a configuration file. Ensure that the value of that is set to a full file path e.g. "D:\SSIS\WebService.wsdl"
Finally, once deployed, ensure that your SSIS package references the configuration file you've created.

SSIS Log file, dynamic file path and access denied error

I have a parent package where I set a variable pointing to a folder where I want to write the execution log of the package. This parent package executes child packages and set value for child's variables too.
In child packages the package logging is stetted up and the connection string to log file is built with the expression:
[User::LogFolder] + "\\" + [System::PackageName] + ".log"
But my package always fail in the first step with this message:
Error: 0xC001404B at Child Package, Log provider "SSIS log provider for Text files": The SSIS logging provider has failed to open the log. Error code: 0x80070005. Acces denied.
The error happens inside BIDS. If I set the path to the log file statically to the same path, then it runs without problems, so it doesn't seems to be a permissions problem. Any suggestion on how to solve this?
Thanks in advance.
Edit: The problem seems to happen because [User::LogFolder] value is obtained from parent package, and when the package tries to open the log the values have not been passed yet, causing the error. Is there a way to solve this?
I found the answer. For the records, the problem was that [User::LogFolder] value is obtained from parent package. And the child package was trying to write to the log before the variable value were filled, causing the error.
I solved it hardcoding the log value in the package. :-(

Override SSIS configuration setting on command line?

I'm trying to run an SSIS package from the SQL Server Management Studio, and am having trouble overriding a configuration setting. In my case, it's the location of a flat file. The command I'm using is:
declare #returncode INT
exec #returncode = xp_cmdshell 'dtexec
/SQL "\ImportData"
/SERVER "myserver"
/CONNECTION "ImportData flatfile connection";"C:\files\ballot.dat"
/MAXCONCURRENT " -1 "
/CHECKPOINTING OFF /REPORTING E'
As you can see above, I'm trying to run this using c:\files\ballot.dat as the flat file in question. When doing so however, SSIS reverts to using the setting stored in its configuration file, which points to a different location (and ballot.dat file) on the hard drive.
Is there a way to override that when calling the package from the command line? Thanks for your suggestions.
What you can do is to add an SSIS Package configuration XML file. In this configuration you can specify all connection managers (just include the connection string). save this file as c:\otherconfig.xml or something like that. Edit the file, you should see your connection listed, and you can edit the connection string.
When running the package with dtexec you should be able to run it with that config file using /configuration.
Note also that there are lot of changes from 2005 to 2008 in how connections and package configurations are handled. See http://msdn.microsoft.com/en-us/library/bb500430.aspx for more details.
You need to set the *full" connection string, not just the file name...
/CONNECTION "ImportData flatfile connection";"Provider=...;Data Source=C:\files\ballot.dat"