July 5, 2009 at 2:27 am
Hi All, I have a script that generates Server job details on execution.
I need to store the data in .csv file.
I need to send the Output file in a .csv format to the client and that too via automation....
can anyone plz tell me how to do that?
July 5, 2009 at 3:24 am
use SSIS.
use a data flow task to output your query results to file. use a send mail task to attach the file (the csv you just made) to the mail and send it to whoever.
Its fairly easy to do if you always output to the same filename with overwrite, if you wanted to keep a copy for archive then you could start using variables to change the name of the output file and then use those variables in sql expressions on the mail task.
July 5, 2009 at 9:38 am
rahul.soni2 (7/5/2009)
Hi All, I have a script that generates Server job details on execution.I need to store the data in .csv file.
I need to send the Output file in a .csv format to the client and that too via automation....
can anyone plz tell me how to do that?
You should be able to use the OpenRowset function. You may need to test different providers...
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
July 5, 2009 at 10:56 am
Gosh... I just use good ol' BCP for this type of thing.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply