I have an SSIS package which only includes one task: Backing up of a database. I can change the database to be backed up programmatically (C#) without any problems by changing the connection to be used and/or the connection string. The problem arises when I want to change the location of the back-up file: It seems like I cannot define variables for that purpose and my google search yielded no fruitful results about how to change the "backup file folder" value of the task programmatically.
Asked
Active
Viewed 2,437 times
1 Answers
2
You may want to try this solution.
- Drag and drop a Foreach Loop Container and define a collection with paths where the backup files will be saved
- In the Variable Mappings tab define a variable which will hold a location for a backup file
- Place a Back Up Database Task inside of the Foreach Loop Container.
- Go to the Properties of the Back Up Database Task, open the Expressions window. Choose a DestinationAutoFolderPath and in the expression window use the previously define variable.
Done.

jambis
- 122
- 2
- 10