SolvedPrivate

SSIS File Rename

Posted on 2013-10-28
4
12 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
Comment Utility
>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
Comment Utility
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
Comment Utility
So .. how's it going?
0
 

Author Closing Comment

by:lrbrister
Comment Utility
Sorry for late getback.

Was on a desperately needed vacation.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

SQL Server  2012 Release with lots of Enhancements in Database Engine functions, SSIS, SSRS and some of new services like Data Quality Server and Master Data Service. Of particular interest, and the focus of this Article is SSIS. So, time to elab…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 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

12 Experts available now in Live!

Get 1:1 Help Now