Solved

Incorrect Syntax

Posted on 2011-02-21
2
308 Views
Last Modified: 2012-06-22
Getting an "Incorrect syntax near '+' on the following SQL


exec portal.dbo.sp_portal_SendNotificationEmail @ToAddr ='lrbrister@mycompany.com',@copy_recipients = '',@Bcc = ''
,@Subject = @dealid, @Body ='Cleared Structured AFS for DealID:' + Cast(@dealID as varchar(4)) + ''

Open in new window

0
Comment
Question by:lrbrister
2 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 34943358
you cannot build parameter values during calling a procl
declare @body varchar(max)
set @body = 'Cleared Structured AFS for DealID:' + Cast(@dealID as varchar(4)) + ''
exec portal.dbo.sp_portal_SendNotificationEmail @ToAddr ='lrbrister@mycompany.com',@copy_recipients = '',@Bcc = ''
,@Subject = @dealid, @Body = @body

Open in new window

0
 

Author Closing Comment

by:lrbrister
ID: 34943396
man!  I knew that!

Just going too fast...thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the SELECT statement in SQL and will be exposed to the many uses the SELECT statement has.

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now