Q:

Create Dynamic Path For SSIS Logging with SSIS log provider for Text files

hello i got trouble with Path destination of SSIS log provider for Text files
at first i use the path static like D:\\ but right now the path i want to get the path from sql table and put it on variable,
so i create expression builder for SSIS txt File connection string
@[User::LogPath]+ @[System::PackageName]+ ("_"+(RIGHT((DT_WSTR,4)
DATEPART("yyyy",GetDate()),4)+
RIGHT("0"+(DT_WSTR , 2)
 DATEPART("mm", GetDate()),2)+
RIGHT("0"+(DT_WSTR,2)
DATEPART("dd",GetDate()),2)+"_"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("HH",GetDate()),2)+"_"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("mi",GetDate()),2)+"_"+
RIGHT("0"+(DT_WSTR,2)
DATEPART("SS",GetDate()),2))+".log")

but the @[User::LogPath] didn' give the path value so the txt Log file didn't create

A:

I have this set up and running in all of my SSIS packages, because I like to keep everything table-driven.
In each package I have created a string variable called "LoggingPath," which is populated with a SQL Task using a select statement like the following:
SELECT FilePath
FROM Files
WHERE FileFunction = 'Log'
  AND SSISPackage = 'ImportStuff'

In this SQL Task the ResultSet is set to "Single row". For the Result Set I have the Result Name = 0 and Variable Name = "User::LoggingPath" referencing the before mentioned variable.  I also have delay validation set to "True" for this SQL Task.
When the SQL Task runs it populates the variable that is then used in the following expression (similar to your expression) under the SSIS log text log file:
@[User::LoggingPath] + "\\" +  @[System::PackageName] + "_" + (DT_STR,4,1252)DATEPART  ( "yyyy" , @[System::StartTime]   ) + RIGHT("0" + (DT_STR,4,1252)DATEPART( "mm" ,  @[System::StartTime]  ), 2) + RIGHT("0" + (DT_STR,4,1252)DATEPART( "dd" , @[System::StartTime]   ), 2) + RIGHT("0" + (DT_STR,4,1252)DATEPART( "hh" , @[System::StartTime]   ), 2) + RIGHT("0" + (DT_STR,4,1252)DATEPART( "mi" ,  @[System::StartTime]  ), 2) + RIGHT("0" + (DT_STR,4,1252)DATEPART( "ss" , @[System::StartTime]   ), 2) + ".csv"
Make certain you remember to apply the double backslashes "\\" as shown above.  Hope this helps.
Kosh

