I have a Variable that contains the following expression:
@[User::DestinationDirectory]
+ "\\files\\Charges_"
+ RIGHT("0" + (DT_STR, 2, 1252) DATEPART("dd" , GETDATE()), 2)
+ "_"
+ RIGHT("0" + (DT_STR, 2, 1252) DATEPART("mm" , GETDATE()), 2)
+ "_"
+ (DT_STR, 4, 1252) DATEPART("yyyy" , GETDATE())
+ "_"
+ RIGHT("0" + (DT_STR, 2, 1252)DATEPART("hh", GETDATE()), 2)
+ "_"
+ RIGHT("0" + (DT_STR, 2, 1252)DATEPART("mi", GETDATE()), 2)
+ "_"
+ RIGHT("0" + (DT_STR, 2, 1252)DATEPART("ss", GETDATE()), 2)
+ ".csv"
This variable is used as the file-name for a generated CSV within a Data flow:
Afterwards, I have the following within the Event Handlers/On Post Execute:
This checks if the file has had 0 rows and then deletes the file if it has.
The problem I'm facing is that the value of the variable changes from the time the file is created to the time it does the check to whether it needs to delete it or not.
How can I have the variable maintain its value at the start of the package and it not change?