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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2001-11-19 : 10:39:24
|
| Roger writes "Right now I have a trigger that emails the static person defined in @recipients when an insert is done. What I would like to do is populate the @recipients with the value brought back from the intranet.dbo.ProductDev.email field. Can you help me out. I would greatly appreciate it. You could probably read what I have below better if you copy it and past it in a text editor.CREATE TRIGGER [send_mail] ON dbo.productdevdiscussionFOR INSERTASexec master.dbo.xp_sendmail @recipients = 'Typed Name', @no_header = 'TRUE', @query = 'SELECT intranet.dbo.ProductDevDiscussion.firstname, intranet.dbo.ProductDevDiscussion.lastname, intranet.dbo.ProductDev.productdesc, intranet.dbo.ProductDev.email FROM intranet.dbo.ProductDevDiscussion, intranet.dbo.ProductDev WHERE intranet.dbo.ProductDevDiscussion.rec = (SELECT MAX(intranet.dbo.ProductDevDiscussion.rec) AS toprec FROM intranet.dbo.ProductDevDiscussion) AND intranet.dbo.ProductDevDiscussion.ID = intranet.dbo.ProductDev.ID',@subject = 'A new comment has been submitted',@message = 'A comment has been submitted to the Idea Forum on the following idea:'" |
|
|
|
|
|