471,573 Members | 1,121 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,573 software developers and data experts.

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 4896

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Woodsrunner | last post: by
reply views Thread by brian | last post: by
3 posts views Thread by hbarnett | last post: by
5 posts views Thread by Simon | last post: by
2 posts views Thread by teddarr | last post: by
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

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.