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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xp_sendmail

Status
Not open for further replies.

YuanXu

Technical User
Jun 20, 2001
17
CN
Hi!
When I use xp_sendmail I find problem below:

SELECT @sumstr = 'SELECT SUM (fee) FROM FeeTable WHERE...'

EXEC (@sumstr)

IF @@ROWCOUNT > 0

EXEC master..xp_sendmail @recipients = @recipient,
@message = @sumstr,
@query = @sumstr,
@attachments = 'Result.txt',
@subject = 'Report System',
@attach_results = 'TRUE',
@width = 250,
@no_output = FALSE
The result is: mail is received but the result.txt always be null.

Who can help me?

I want to get the query result in result.txt.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top