This got a little more complicated than I thought. I kind of thought the SSIS Package Variables specified in the SQL Server Agent Job Set andSet values would be satisfied at run time. It seems as though they need to be satisfied correctly prior to run time.
I have a Variable GlobalFilePath which is a fully qualified path name with an embedded space.
\\Location.net\Folder\Sub Folder\...we supplied the Value...
/Set \Package.Variables[User::GlobalFilePath].Properties[Value];"\\Location.net\Folder\Sub Folder\\"
Is that correct?
Our Flat File Connection Manager uses in its Properties ConnectionString @[User::GlobalFileFullyQualified]which is a formula unto itself...
@[User::GlobalFilePath] + @[User::GlobalFileName] + @[User::GlobalFileNameEndDateQualifier] + @[User::GlobalFileType]
So we provided the Set values for \Package.Variables[User::GlobalFileName].Properties[Value] to be...
/Set \Package.Variables[User::GlobalFileName].Properties[Value];"WD_ClientName_846_Inventory_"
Now the @[User::GlobalFileNameEndDateQualifier] is satisfied within the SSIS Package with the following Expression...
(DT_WSTR, 4) YEAR( @[User::GlobalDate] ) + RIGHT( "0" + (DT_WSTR, 2) MONTH( @[User::GlobalDate]),2 ) + RIGHT( "0" + (DT_WSTR, 2) DAY( @[User::GlobalDate]),2 )
And the GlobalDate Variable is being satisfied within the SSIS Package by an Execute SQL Task with Direct Input T-SQL...
SELECTCONVERT(DATE, GETUTCDATE() AT TIME ZONE 'UTC' AT TIME ZONE 'Eastern Standard Time')AS[DateIn]
And Storing [Datein] to Result Set User::GlobalDate
When attempting to run the SQL Server Agent Job, we get the error message...
Source: IRIS Datapass 846File Connection manager "Flat File Connection Manager - Eagle 846 Inventory File" Description: The file name "/Set \Package.Variables[User::GlobalFilePath].Properties[Value];"\\Location.net\Folder\Sub Folder\"/Set \Package.Variables[User::GlobalFileName].Properties[Value];"WD_ClientName_846_Inventory_"20190517/Set \Package.Variables[User::GlobalFileType].Properties[Value];".csv"" specified in the connection was not valid. End Error Error: 2019-12-24 12:10:01.13 Code: 0xC001401D Source: IRIS Datapass 846File Description: Connection "Flat File Connection Manager - Eagle 846 Inventory File" failed validation. End Error Error: 2019-12-24 12:10:01.13 Code: 0xC001401E Source: IRIS Datapass 846File Connection manager "Flat File Connection Manager - Eagle 846 Inventory File" Description: The file name "/Set \Package.Variables[User::GlobalFilePath].Properties[Value];"\\Location.net\Folder\Sub Folder\"/Set \Package.Variables[User::GlobalFileName].Properties[Value];"WD_ClientName_846_Inventory_"20190517/Set \Package.Variables[User::GlobalFileType].Properties[Value];".csv"" specified in the connection was not valid. End Error Error: 2019-12-24 12:10:01.13 Code: 0xC0202070 Source: IRIS Datapass 846File Connection manager "Flat File Connection Manager - Eagle 846 Inventory File" Description: The file name property is not valid. The file name is a device or contains invalid characters. End Error DTExec: The package execution returned DTSER_FAILURE (1). Started: 12:10:01 PM Finished: 12:10:01 PM Elapsed: 0.219 seconds. The package execution failed. The step failed.
Now that value "20190517" is what is hard-coded in the SSIS Package for VariableGlobalFileNameEndDateQualifier even though the Expression for that variable is...
(DT_WSTR, 4) YEAR( @[User::GlobalDate] ) + RIGHT( "0" + (DT_WSTR, 2) MONTH( @[User::GlobalDate]),2 ) + RIGHT( "0" + (DT_WSTR, 2) DAY( @[User::GlobalDate]),2 )
How can I fix this? Do I need to satisfy the Set values for GlobalDate even though it will be satisfied in the SSIS Package?
Thanks for your review and am hopeful for a reply.