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
 General SQL Server Forums
 New to SQL Server Programming
 Updating Multiple Records in A Single Table

Author  Topic 

djpin
Starting Member

27 Posts

Posted - 2014-09-03 : 08:52:44
Hi,

I'm trying to update a checkbox from "False" to "True" within a single table for multiple records. I can update a single record using the script below. However, I'm having trouble applying additional Id's to the string.

(Works) - Update Name_Demo set KEY_CONTACT = 'true' where ID = 225249

(doesn't work) - Update Name_Demo set KEY_CONTACT = 'true' where ID = '225249, 210014, 216543'
It says query executes successfully but returned no rows.

Not sure what I'm doing wrong.

Thanks,

DJ

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2014-09-03 : 08:56:37
can you try this
where ID in(225249,210014,216543)

Javeed Ahmed
Go to Top of Page

djpin
Starting Member

27 Posts

Posted - 2014-09-03 : 09:04:59
That worked! I really appreciate your help.

Thanks

Thanks,

DJ
Go to Top of Page

ahmeds08
Aged Yak Warrior

737 Posts

Posted - 2014-09-03 : 09:07:49
welcome

Javeed Ahmed
Go to Top of Page
   

- Advertisement -