SolvedPrivate

SSIS File Rename

Posted on 2013-10-28
4
16 Views
Last Modified: 2016-02-11
I have a SSIS Export File process that is working.
The csv file is created and named with logic

@[User::strFolderName] +"\\"+ @[User::strFileName]+ @[User::strFileWeek]+".csv"

I've been asked to build the files with

@[User::strFolderName] +"\\"+ @[User::strFileName]+ @[User::strSeq] + ".csv"

The strSeq variable needs to be  a "stepped" number.
10,20,30,40,etc...

How would I go about that in SSIS for VS 2005?
0
Comment
Question by:lrbrister
  • 3
4 Comments
 
LVL 65

Accepted Solution

by:
Jim Horn earned 500 total points
ID: 39605750
>The strSeq variable needs to be  a "stepped" number.
Does 'the files' use a ForEach File Loop?    If so, it wouldn't be too tough to create a variable iSteppedNumber, and then in your loop a script task that uses it as a readwrite variable that does this...
Dts.Variables("iSteppedNumber").Value = Dts.Variables("iSteppedNumber").Value + 10

Open in new window

... then uses it to set the connection file name ..
Dim sFile As String

sFile = Dts.Variables(strFolderName).Value.ToString & 
      Dts.Variables(strFileName).Value.ToString & 
      Dts.Variables(iSteppedNumber).Value.ToString & 
       ".csv"

'Set the connection
Dts.Connections("your_connection").ConnectionString = sFile

Open in new window

0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39606072
If you want to keep the above logic, you can do that, but you'll still (afaik) need the script task to 'incriment' the  strSeq / iSteppedNumber variable before each data pump.
0
 
LVL 65

Expert Comment

by:Jim Horn
ID: 39608843
So .. how's it going?
0
 

Author Closing Comment

by:lrbrister
ID: 39611927
Sorry for late getback.

Was on a desperately needed vacation.
0

Featured Post

Webinar: Aligning, Automating, Winning

Join Dan Russo, Senior Manager of Operations Intelligence, for an in-depth discussion on how Dealertrack, leading provider of integrated digital solutions for the automotive industry, transformed their DevOps processes to increase collaboration and move with greater velocity.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question