December 8, 2004 at 3:13 pm
Hi,
I am having problems when attaching the results of a stored procedure using the xp_sendmail extended procedure. The file that is attached does not stay in the 3 column format displayed in Query Analyser when you execute the stored procedure. The attachment is also full of white spaces.
Can anyone help?
Regards
Steve
December 13, 2004 at 8:00 am
This was removed by the editor as SPAM
December 16, 2004 at 10:32 am
Are you defining a specific separator? If not try defining it as a comma and you should get a comma delimited attachment that should be easy to open with spreadsheets and the like.
If the phone doesn't ring...It's me.
December 17, 2004 at 11:39 am
Make sure you have the @width parameter set or you'll encounter formatting issues like the one you mentioned.
For example:
exec master..xp_sendmail @recipients = @v_RecipientList,
@query = @v_sql,
@attach_results = 'true',
@message = @v_msg,
@width = 2000,
@subject = @v_sub,
@attachments = 'PointsByEmployee.txt'
And as Charles mentioned, use @separator if necessary. Check SQL Books On-Line for more options.
December 19, 2004 at 2:09 pm
Thanks for you help guys. Have it sorted now.
Cheers
Steve
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply