By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,028 Members | 1,066 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,028 IT Pros & Developers. It's quick & easy.

SQL Update HELP!!!

P: 5
Hi there,

I need to know how to update multiple records using 1 query.
For example:
UPDATE NPRG_Combined
SET unsubscribe = '0'
WHERE contact_id = '77214', '77215', '77216'

This query gives me this error:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ','.

What am I doing wrong?

Thanks,
Elizabeth
Mar 28 '07 #1
Share this Question
Share on Google+
6 Replies


iburyak
Expert 100+
P: 1,017
Try this:


[PHP]UPDATE NPRG_Combined
SET unsubscribe = '0'
WHERE contact_id in ('77214', '77215', '77216')[/PHP]

Good Luck.
Mar 28 '07 #2

P: 5
I love you!!!! Thank you!
Mar 28 '07 #3

iburyak
Expert 100+
P: 1,017
I love you too... :)
Mar 28 '07 #4

P: 5
Wow great we are a match! I would marry you if you know how to use Lyris ListManager 9.2. Are you familiar with that?
Mar 28 '07 #5

iburyak
Expert 100+
P: 1,017
http://www.lyris.com/resources/tips/
Mar 28 '07 #6

P: 5
Thanks, we'll take a look at this. Have a great weekend!
Mar 30 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.