0

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.

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
schlingel
  • 1,514
  • 2
  • 15
  • 24

1 Answers1

2

You may want to try this solution.

  1. Drag and drop a Foreach Loop Container and define a collection with paths where the backup files will be saved
  2. In the Variable Mappings tab define a variable which will hold a location for a backup file
  3. Place a Back Up Database Task inside of the Foreach Loop Container.
  4. 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