Solved

Incorrect Syntax

Posted on 2011-02-21
2
321 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

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

773 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