70 pts.
 Why does my SQL Trigger malfunction?
I have the following code installed on my database. Create Trigger CFXSOUpdate On SalesOrder For Update AS If Update(SOM_DefaultRequiredDate) or Update(SOM_DefaultShipMethod) Declare @Body varchar (100) Set @Body= 'The Required Date or Ship Method has been changed' Exec master..xp_sendmail @recipients = 'ARaedeke@Tri-Optic.com', @subject = 'Sales Order Change', @message = '@Body' The trigger fires when the fields are updated, but the email message only has the word @body in it. No sign of the message I intend to send. Thanks for the help, Arlin

Software/Hardware used:
ASKED: February 5, 2009  6:43 PM
UPDATED: February 17, 2009  11:34 PM

Answer Wiki:
Try removing the quotes from this line: <pre>@message = '@Body'</pre> i.e. <pre>@message = @Body</pre>
Last Wiki Answer Submitted:  February 5, 2009  7:02 pm  by  carlosdl   63,535 pts.
All Answer Wiki Contributors:  carlosdl   63,535 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

Thanks Carlos.
I won’t be able to try the code again until Monday.
I’ll let you know if it worked.
Arlin

 70 pts.

 

Removing the quotes did the trick.
Thanks,
Arlin

 70 pts.