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 - 2000-10-29 : 23:14:31
|
Mark writes "Okies, got an interesting problem that I can't find an online example of.. Let me describe the setup.
An table exists in the master database that contains 3 coloumns... email, ComEmail, reason. There exists a trigger on the table on insert. This trigger (which is almost 150 lines long now) runs xp_sendmail. it reads from the inserted table (to get the data just inserted) email, comemail, reason and records them as @email, @comEmail, @reason. It then goes through various if statements setting @subject and @msg to whatever the email text msg should be. IE/ if reason = insert on users table @msg = 'this email is to inform you of the new user added to the table' (well.. not exactly what the msg says, but ya get the point). So far so good.. however it hits a slight snag
the final line is as follows execute xp_sendmail @recipients = @email ; @comemail @subject = @subject @message = @msg
this statement works if there is @recipients = @email or @recipients = @ComEmail, however is doesn't like multiple variables in the recipients. Perhaps it's just my syntax thats wrong, but I can't really find anything that shows me to the wise (the @email ; @comemail seems to be the way the syntax guide shows it).
oh, just read bottom line of this (hopefully I under 4k chars. and it's winNT4 and MSSQL7.0)
Thanks for your time, Mark" |
|
|
|
|
|