SolvedPrivate

SSIS File Rename

Posted on 2013-10-28
4
13 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

My client sends a request to me that they want me to load data, which will be returned by Web Service APIs, and do some transformation before importing to database. In this article, I will provide an approach to load data with Web Service Task and X…
Here's a requirements document template for an integration project (also known as Extract-Transform-Load or ETL) based on my development experience as an SQL Server Information Services (SSIS) developer over the years.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

867 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now