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

How to pass variable value to xp_sendmail

Status
Not open for further replies.

mwlyoung

Programmer
Jan 9, 2003
7
ZA
Hi there

I want to pass a variable value to the xp_sendmail procedure such as the following:

EXEC xp_sendmail @recipients = @email,
@query = 'SELECT * from myTable inner join anotherTable on myTable.myColumn = anotherTable.anotherColumn',
@subject = 'Report',
@message = 'This is a test message:',
@dbuse = 'myDB'

but this gives me the following error message:

Server: Msg 17963, Level 16, State 1, Line 0
xp_sendmail: Procedure xp_sendmail expects parameter @recipients, which was not supplied.

Does anyone know how I can get past this?

Thanks in advance
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top