Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 how to extend ssis package to do another task

Author  Topic 

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-13 : 18:39:49
Hello All,

1 process) extract data from text file and store in database table, after this, sql procedure will execute (through Execute Sql Task) it will store some data in a table.

2process:-required)
now it needs to be extend
to the above one how can i create a CSV file, with the data of temporary table

Can you please give me an idea

Best Regards
asini

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-13 : 18:47:32
Do you mean again you want to export it back to CSV?
Go to Top of Page

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-13 : 19:15:42
quote:
Originally posted by sodeep

Do you mean again you want to export it back to CSV?



SoDeep,

yes, as soon as Execute Sql task finishes work(it will loads some data to some table) then i want to export table data to csv and save in some folder

Thanks & Regards
asini
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-13 : 19:26:36
Use Flat File Destination and assign the folder
Go to Top of Page

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-13 : 19:38:06
quote:
Originally posted by sodeep

Use Flat File Destination and assign the folder



i tried it in Data flow tab (Flat File Destination), but unfortunately i cant setup the source. how can i set the source,

my current package process is
1) loops the folder to find some .ctd extension files in it
2) then derived column task is to create additional column to flat file column (step 1 columns)
3) load in to temp table
4) sql procedure task (check & delete some records in tableA, and updates records in tableA then insert to another tableb)

so here i want to write table A values to csv file

========== some more explanation

we can do in a new package, as source is Sql server table and destination is file system(CSV).
instead of creating separat package, is there any way to extend the current one
can we create multiple tasks in single package (such as 1st task is upto execute sql task)
if yes then can we set order or execution for tasks (2nd is execute export to csv task)

please correct me if i am wrong

and give me any suggestions regarding to this

Thanks & Regards
asini
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-13 : 19:53:29
Use this:

http://ankeet1.blogspot.com/2008/04/using-foreach-loop-container-in-ssis.html
Go to Top of Page

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-14 : 09:28:31
quote:
Originally posted by sodeep

Use this:

http://ankeet1.blogspot.com/2008/04/using-foreach-loop-container-in-ssis.html



Hi Sodeep,

thnakyou for your reply sodeep,

it seems to be not the solution for this problem

in my project, till now (procedue will execute through Execute Sql task) --> actually this procedure is loads some data into tableA
so now user requirement is, after execute sql procedure, it needs to generate one csv file from the tableA(having data by previous task).

Thanks & Regards
asini
Go to Top of Page

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-14 : 12:03:53
Sodeep,

finally i got it,
by adding dataflowtask in control flow then in this data flow task i put source as oledb source and destination as flatfiledestination

then finally it work

thank you very much for your replies

Best Regards
asini
Go to Top of Page

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-14 : 18:49:20
Hello All,



here when i am using Source as OLEDB (sql table) and destination is Flatfiledestination (CSV file),

in csv files no column headings (it loads only data of the table)



can any one please tell me that, how can i get the column names in the first row of the csv file



Thanks & Regards

asini
Go to Top of Page

sodeep
Master Smack Fu Yak Hacker

7174 Posts

Posted - 2008-10-14 : 18:57:25
Choose Column name in First data row in Flat file Dest.
Go to Top of Page

dhani
Posting Yak Master

132 Posts

Posted - 2008-10-14 : 19:27:58
quote:
Originally posted by sodeep

Choose Column name in First data row in Flat file Dest.



Sodeep,

thank you for your reply, i tried before i post this question, but it didn't work out, however i tried it once again after your reply
now it is working fine.

but in continue with this i found another problem
i.e when i write data to csv file it needs to be each value surround with double quote value.

hense i selected the option Text Qualifier as " so it is also working fine, but the problem is double quotes is applying to column headers to

how can i eliminate the double quotes only for column headers and remain with values

thanks in advance
asini
Go to Top of Page
   

- Advertisement -