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.

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Syntax error - trying to use OUTPUT in an UPDATE q

Author  Topic 

jackie11
Starting Member

3 Posts

Posted - 2015-03-31 : 06:26:52
Hi there

I am trying to use OUTPUT in an UPDATE query, this is my query:

Update Package SET Product_ID = " + p + " OUTPUT inserted.Package_ID WHERE Email = '" + ID + "' AND Lower(IsOpen) = 'true';

Where p is an int, and ID is a string(as its an email) address. I am getting a syntax error saying theres a missing operator within the " " + p + " OUTPUT inserted.Package_ID " bit

Can anyone help me??

Many thanks

gbritton
Master Smack Fu Yak Hacker

2780 Posts

Posted - 2015-03-31 : 22:10:09
try changing your double quotes to single quotes
Go to Top of Page
   

- Advertisement -