?
Solved

Incorrect Syntax

Posted on 2011-02-21
2
Medium Priority
?
359 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

Question has a verified solution.

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

Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

770 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