August 31, 2012 at 1:20 pm
i am putting my query in sql commnad,getting syntax error
update dbo.Test
join
Archive
on Test .Id = Archive.lId
set Test.Processed = Archive.Processed
any help?
August 31, 2012 at 1:26 pm
update dbo.Test
join
Archive
on Test .Id = Archive.lId
set Test.Processed = Archive.Processed
I don't see a SET statement or a FROM statement. I'd suggest checking your update in SSMS before placing it in a SQL task.
August 31, 2012 at 1:47 pm
To go off what kl25 said, your set statement is in the wrong place and you'll need a from statement in there, so it should look something like this, but note I have no way to test this so I don't know if it's what you actually want:
update test
set test.Processed = archive.Processed
from dbo.Test test
join dbo.Archive archive on Test.Id = Archive.lId
I would recommend running a select in SSMS first to verify you are changing what you want to:
select test.Processed as Old_Value, archive.Processed as New_Value
from dbo.Test test
join dbo.Archive archive on Test.Id = Archive.lId
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy