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
 General SQL Server Forums
 Script Library
 save query results to a csv file and email

Author  Topic 

smalya
Starting Member

2 Posts

Posted - 2012-03-23 : 21:17:50
HI ,

I have a view from which I want to select all columns (alon with column name) and save results in a csv or excel file . Once this is complete, I want to attach this csv in an email and send to audience.
Please help me as I am new to SQL server 2005.
Kindly advise how this can be automated.

SUD

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-03-23 : 23:24:07
try bcp and use sp_send_dbmail to email

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

smalya
Starting Member

2 Posts

Posted - 2012-03-26 : 06:35:16
Thanks. Whats the exact format to use BCP


quote:
Originally posted by visakh16

try bcp and use sp_send_dbmail to email

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/





SUD
Go to Top of Page
   

- Advertisement -