469,097 Members | 1,280 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,097 developers. It's quick & easy.

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 4799

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 kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.