Solved

Incorrect Syntax

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
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.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

759 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

17 Experts available now in Live!

Get 1:1 Help Now