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
SolvedPrivate

SSIS File Rename

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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

860 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