473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ssis - Export to a file and Rename file

I have a table, that has a column which determines the file name. I
want to export a file and rename it immediately.

For Ex:
Select Id, count(*)
from Mytable
group by ID

gives the following:

ID Count
1 100
2 200
4 50

Now in my SSIS package, I am able to create a Execute SQL task (Select
distinct ID from MyTable), followed by a For Each loop container.
Inside the For Each loop container, I have a OLE DB source and a flat
file destination. OLE DB source has the following: select top 10 *
from MyTable where id =?. I am able to eport file for ID=1. Then
it gets replaced by file for ID=2 which then gets replaced by file for
ID = 4. So I want the test.txt to be renamed to test1.txt, test2.txt
and text4.txt. I tried using File system task or Execute process
task. It did not work. Please let me know how I could make it work.
Thank you for your help.

Apr 12 '07 #1
0 4976

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Woodsrunner | last post by:
Not running my own server. My site host says I can use SSIs on my pages. When I try the supposedly "included" info never shows up in any browser I've tried. On pages where info (tags, etc) is...
5
by: Tim Eliot | last post by:
Just wondering if anyone has hit the following issue and how you might have sorted it out. I am using the command: DoCmd.TransferText acExportMerge, , stDataSource, stFileName, True after...
1
by: Bridget Willey | last post by:
I am using ACT 6 and am trying to "split" the database between records for customers and junk records. The accounts designated as "customers" have that word in the ID field, and I am using that...
0
by: brian | last post by:
Hi there, I'm trying to figure out to to invoke the SqlServer 2005 Import/Export wizard programatically. I.e. Export DatabaseA.TableA to DatabaseB.TableA SqlBulkCopy seems nice but my...
3
by: hbarnett | last post by:
I am in process of converting Access 97 databases to Access 2003. Some of the Access 97 databases export data to a text file with a non standard file extension, such as "ext" or "NAL". When I try...
5
by: Simon | last post by:
Dear reader, With the export command you can export a query to Excel. By activate this command a form pop's up with the following text:
0
by: Silly Milly | last post by:
Calling ALL SSIS GURUS I am trying to import identical MDBs (Access Database) columns into SQL Server 2005 using foreach loop in SSIS. The data and file name of the MDBs are not the same; however...
2
by: teddarr | last post by:
I have a task to perform and I need some advice. I am using SQL Server Management Studio and I am creating an SSIS package that will automatically perform a stored procedure, load the data into an...
3
by: stephen | last post by:
I had to use use ssis 2005 in a short project recently & had little time to work it out. I was importing a whole bunch of flat files into SQL Server tables with many derived columns and...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.