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 - 2002-07-11 : 09:22:17
|
| david majors writes "Dear Sql Team,I have a database of customers that I am trying to send email messages reminding them of their past due balance. All recipients have email addresses. WHEN I ISSUE THIS SCRIPT I GET AN ERROR: Rock Island Acct.#3100SANTA MARKET 10.30Msg 17914, Level 18, State 1Unknown recipient: Parameter '@recipients', recipient '@MyRecipients'This is my script:SET NOCOUNT ONDeclare @MyRecipients varchar (255)Declare @MySubject varchar (255)Declare @MyMessage varchar (255)Declare @MyBalance varchar (255)Declare @MyNumber varchar (255)Declare @MyCompany varchar (255)Set @MySubject='Rock Island Reminder'Set @MyMessage = '****ROCK ISLAND REMINDER**** This is to inform you that your account is Past Due. Please contact our office to discuss your account @ 415-884-6466 Mon-Fri 8:00 AM to 5:00 PM.'Declare MyCursor Cursor For Select rcust.emailaddresspart,rcust.Accountbalance,'Rock Island Acct.#' + rcust.CustomerNumber,rcust.CustomerName From RCUSTWhere rcust.AccountBalance>0.01 AND rcust.emailaddresspart like '%@%' Open MyCursorFetch Next From MyCursor Into @MyRecipients,@MyBalance,@MyNumber,@MyCompanyWhile @@Fetch_Status = 0BEGINPrint @MyRecipientsPrint @MyNumberPrint @MyCompanyPrint @MyBalanceFetch Next From MyCursor Into @MyRecipients,@MyBalance,@MyNumber,@MyCompanyExec Master.dbo.xp_sendmail @Recipients='@MyRecipients',@Subject=@MyNumber,@Message=@MyMessageEnd Close MyCursorDeallocate MyCursor**************Please let me know what the problem is. I checked the sql mail and it works fine. ***********.David" |
|
|
AndrewMurphy
Master Smack Fu Yak Hacker
2916 Posts |
Posted - 2002-07-11 : 09:38:51
|
| only issue I can see is the single quotes around '@MyRecipients', why are they there?....your other text fields don't have quotes around them when you are passing them in...... |
 |
|
|
|
|
|
|
|