473,397 Members | 1,949 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

SQL Update HELP!!!

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
6 1532
iburyak
1,017 Expert 512MB
Try this:


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

Good Luck.
Mar 28 '07 #2
estark
5
I love you!!!! Thank you!
Mar 28 '07 #3
iburyak
1,017 Expert 512MB
I love you too... :)
Mar 28 '07 #4
estark
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
1,017 Expert 512MB
http://www.lyris.com/resources/tips/
Mar 28 '07 #6
estark
5
Thanks, we'll take a look at this. Have a great weekend!
Mar 30 '07 #7

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

Similar topics

6
by: Paul Eden | last post by:
Hello all. I'm totally stumped. Please de-stump me! I've read my data in from the database, changed it according to what i want to do and now I want to write it back. But it seems I can only...
1
by: MattMika | last post by:
I am trying to integrate a Credit Card # deletion option into Batch_print_center and need some help. Batch_print_center has a form where you specify orders you want to print or proccess by...
8
by: Jason | last post by:
I have a table that matches up Securities and Exchanges. Individual securities can belong on multiple exchanges. One of the columns, named PrimaryExchangeFlag, indicates if a particular exchange is...
7
by: Steve B. | last post by:
Does anyone know why the DA Update() would throw an exception? I moved the database but I updated the Conn and the DA, currently (trying)removing/replacing DS. Is there a another direction I...
0
by: Ash | last post by:
Hi, I'm using Vb.NET webform, connecting to sql server database on the local machine. I used datagrid propery builder to add the edit, update and cancel colum. On the code, i have: Private...
4
by: Mike | last post by:
I have an update page and on the page there are sometimes names with 's (car's) in it When I try to update it i get a syntax error. How can i update the record with a 's (car's) in the name? thx
2
by: billr | last post by:
SQL newby in deep water thats way over my head. Any help appreciated. I am trying to retrieve data from field in one table and append it to on field in a second table. Each the fields had a Field ID...
0
by: Mangler | last post by:
I have a form that does multiple updates on the page. For some reason that I cant figure out it is redirecting before the update is done. It doesnt do this on another page that I have. <% If...
7
by: wizardry | last post by:
i can query the list fine using: select list.list, many_table.list_id_fk from list left join many_table on list.id = many_table.list_id_fk and many_table.userid = 'UserId'; that populates...
1
by: donken | last post by:
Hi I'm trying to update changes made in a dataset to an existing .dbf file. But I can't figure it out. I connect to the file via ODBC connection and the updates to the DataSet works fine but then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.