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!
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!