dbTalk Databases Forums  

ssis - Export to a file and Rename file

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss ssis - Export to a file and Rename file in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
gelangov@hotmail.com
 
Posts: n/a

Default ssis - Export to a file and Rename file - 04-12-2007 , 02:25 PM






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.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.