SSIS 2008 Execute Package Task Connection Expression not valid - ssis

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\""

Related

Parameterized Flat File Connection String

I'm using a Script Task(VB) to get the complete file path for a specific csv file that I want to load in SQL Server table. In the Script Task I loop through the directory (based on certain conditions) and assign the file path to a writable package variable as:
Dts.Variables("User::strPFilePath").Value = Folder + "\" + File.Name
Now I have the complete CSV file path and I set this up by parameterizing the csv connection manager with the property expression ConnectionString using this variable to dynamically assign the connection string.
This works fine when I run the package in Visual Studio but when I deploy it to SQL Server under SSISDB folder I get the following error specifically at that script task:
Exception has been thrown by the target of an invocation
The Data Flow Task after the script task generates the following error:
Cannot open the datafile""
The second message to me implies that the file path is not being passed dynamically to the ConnectionManager for the CSV.
Any ideas on how I can fix this or deploy it properly?
Thanks

Dynamically set connection string of SSIS package through cmd

I am trying to dynamically set the connection string of my SSIS package through DTEXEC.exe
My CMD file consists of following command.
"C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DTEXEC.exe" /f
"D:\ABC\XYZ\Packages\ABCD.dtsx" /CHECKPOINTING OFF /REPORTING V /CONSOLELOG/Conn
"Configurations;'"Data Source=XXXXXX;Initial Catalog=YYYY;Provider=SQLNCLI10.1;Integrated
Security=SSPI;Auto Translate=False;'"" /SET
"\Package.Variables[User::TargetEnvironmentId].Properties[Value]";"2"
If i take out connection string part it works fine but when i add
/Conn "Configurations;'"Data Source=XXXXXX;Initial Catalog=YYYY;Provider=SQLNCLI10.1;
Integrated Security=SSPI;Auto Translate=False;'""
This it throws exception and says INVALID
Is the name of your connection manager called "Configurations"? I can only assume that is the case. Give the following a try:
/CONNECTION "Configurations";"\"Data Source=XXXX;Initial Catalog=YYYY;Provider=SQLNCLI10.1;Integrated Security=SSPI;Auto Translate=False;\""
I always find it easier to use DTExecUI to create the script, have you tried doing that?
Either that or set the connection string as a variable and pass that through DTExec

Passing connection string properties when using DTEXEC

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;"\"

SSIS Main Package throwing Error : Package Failed Validation From Execute Package Task

i have a Main Package and 2 child packages(Load and Export). i have both child packages on the server in shared folder. when i execute Main Package its giving me the following Error for one of the Child package.
Error: Error 0xC0012050 while loading package file "\mhfile02\DIRFILEDEV\CHG77253\SSIS Packages\AaeAutoenrollee_Load.dtsx". Package failed validation from the ExecutePackage task. The package cannot run. .
Can anybody tell me what could be wrong?
Thanks
Are you running the package via SQL Server Agent?
Try running the child packages individually, it may be throwing other errors. If the package runs without error, the problem is probably on the Main package settings.
Some questions that may help you?
1. when you loaded the packages to the server, did you set any Protection Level (eg encrypt sensitive data with key, user key, etc?) setting these can make a package fail loading when run via SQL Server Agent
2. Try adding /msdb/ to the path of the child package.
If you are connecting in the child package to an Excel file,
and you set on the child solution property page
Under -
"Configuration Propeties"
"Debugging"
the variable "Run64BitRunTime" = False
You have to do it also on the Parent Package!
This error message means that your child package will not pass the validation. Check your child package to see if there's any task inside that does not pass the validation (a red cross appears beside it).
Maybe you have something being dynamically created that is used in such task (like constructing the connection string at runtime for some connection manager). Try set this task's DelayValidation property to True.
From one day to another, I got this error in Visual Studio / SSDT too (VS 2013, with SSIS 2014). Note: I have project deployment model, not package deployment.
I have ProtectionLevel = EncryptSensitiveWithPassword.
In the master package, on all package execution tasks, I had to retype the password for the sub-packages again. After that, it worked again. I guess the master package had some corruption, no idea why.
Greetings,
Roli
If you are connecting in the child package to an Excel file, then set DelayValidation = False on the child package excel connection manager.

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"