Lidou123
Lidou123

Reputation: 155

How to create dynamic folder and subfolder to insert exported files into?

In my actual project, my boss asked me to export data from database to csv flat files.

So, as I don't know .net code, I use SSIS File System task and ForEach Loop Container.

I built a package which:

  1. Select data filtered by year, month and region
  2. Create differents folder to archive files exported like this:

A- Year\MONTH\REGION\ .csvfiles

One difficulty that I have is to create folder and sub folder only if it does not exist.

Upvotes: 0

Views: 1270

Answers (1)

billinkc
billinkc

Reputation: 61211

I'm lazy, I'd drop a Script Task in the Foreach Loop Container and make use of the System.IO.Directory. Specifically, I'd use Exists and CreateDirectory

Upvotes: 1

Related Questions