SSIS help

  • I manually run reports now in the following manner:

    Run two different sql scripts that pull data from yesterdays date, I right click on results and save results as 2 separate csv files.

    Now I need to automate the process.

    I have a drive mapped where I drop the 2 files in 2 directories. I currently name the files with yesterdays date in the file name. There is a process that looks for new files in the directory, pulls data needed for accounting system and moves the files to an archive directory.

    As I understand the SSIS export, it is looking for an existing file to put the data in. Is there a way to do this in the following way:

    Pull data from two tables, save results in csv files named with yesterdays date, save results in 2 different mapped drive directories that are empty.

    Can someone help me out with some steps?

  • dchapman 44037 (9/3/2013)


    I manually run reports now in the following manner:

    Run two different sql scripts that pull data from yesterdays date, I right click on results and save results as 2 separate csv files.

    Now I need to automate the process.

    I have a drive mapped where I drop the 2 files in 2 directories. I currently name the files with yesterdays date in the file name. There is a process that looks for new files in the directory, pulls data needed for accounting system and moves the files to an archive directory.

    As I understand the SSIS export, it is looking for an existing file to put the data in. Is there a way to do this in the following way:

    Pull data from two tables, save results in csv files named with yesterdays date, save results in 2 different mapped drive directories that are empty.

    Can someone help me out with some steps?

    1) Create dynamic variables containing desired filename1 and filename2 (ie strings with date as a part of them, in desired format)

    2) Run data flow to create file1 (fixed file name)

    3) Run data flow to create file2 (fixed file name)

    4) Use two file system tasks to rename the files (using the variables in (1))

    5) Use two file system tasks to move the renamed files to the desired folder.

    Note 1: items 4 and 5 can be easily accomplished in a single Script Task (that's what I would do)

    Note 2: using mapped drives is often problematic & I suggest using UNC paths instead.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • Thanks for the reply. Just what I needed!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply