Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mail Attachment Error

Status
Not open for further replies.

gsavitha

MIS
Jan 28, 2011
14
0
0
GB
Hi all,

EXEC msdb.dbo.sp_send_dbmail
@recipients='sg@domainname.com',
@body='Message Body',
@subject ='Message Subject',
@profile_name ='test',
@query ='select top 10 * from [databasename].dbo.cst ',
@attach_query_result_as_file = 1,
@query_attachment_filename ='Results.csv'

This query is working.

But the datas in the Result file, which i getting in mail is not properly organised.and scrated.What i need to do to get the mail attachment file in correct formatas look likes in sql query result??

Any help would be highly appreciated.Thanks in advance..
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top