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 2000 Forums
 SQL Server Development (2000)
 Name of file attachment using xp_sendmail

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-12 : 09:05:48
Adrian writes "Hi Guys,

I'm using xp_sendemail to attach the results of a query as a file, without putting it onto the file system first.
However, SQL Server gives me a random filename each time.
Do you know if there is a way of choosing the filename of the attachment, or at least being able to read it before the email is sent?
I need to write the name of the file in the body of the email.

This is how I'm calling the procedure:

exec master.dbo.xp_sendmail @recipients = 'przelona@anz.com',
@subject = 'Test Subject',
@message = 'Test Body',
@query='SELECT * FROM email',
@attach_results=true,
@no_header=true,
@separator="",
@width=400


I've done a bit of research, and apparently another version of xp_sendmail exists which takes a @attachname parameter which lets the user specify the name of the attachment. Do you know anything about that?


Thanks for your help."
   

- Advertisement -