?
SolvedPrivate

SSIS File Rename

Posted on 2013-10-28
4
Medium Priority
?
19 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 66

Accepted Solution

by:
Jim Horn earned 2000 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 66

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 66

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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Lessons learned during ten years of interviewing for SQL Server Integration Services (SSIS) and other Extract-Transform-Load (ETL) contract roles and two years of staff manager interviewing contractors.
My client sends data in an Excel file to me to load them into Staging database. The file contains many sheets that they have same structure. In this article, I would like to share the simple way to load data of multiple sheets by using SSIS.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

801 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