473,396 Members | 1,834 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,396 software developers and data experts.

Updating text fields

I am trying to update text fields where the field only has the value
"closed." So a field that has closed and anything else will not be
updated.
update dbo.Hist
set dbo.Hist.Notes = ''
FROM dbo.Hist
WHERE (Notes LIKE 'closed_')

update dbo.Hist
set dbo.Hist.Notes = ''
FROM dbo.Hist
WHERE (Notes LIKE 'closed%') and len(convert
(varchar(7000),notes)) = 7

Neither code works and i get this error: "Subquery returned more than
1 value. This is not permitted when the subquery follows =, !=, <, <=
, >, >= or when the subquery is used as an expression.
The statement has been terminated."

What's another way to make the update?
Jul 20 '05 #1
1 1359
[posted and mailed, please reply in news]

ChrisL (ch***********@gmail.com) writes:
I am trying to update text fields where the field only has the value
"closed." So a field that has closed and anything else will not be
updated.
update dbo.Hist
set dbo.Hist.Notes = ''
FROM dbo.Hist
WHERE (Notes LIKE 'closed_')

update dbo.Hist
set dbo.Hist.Notes = ''
FROM dbo.Hist
WHERE (Notes LIKE 'closed%') and len(convert
(varchar(7000),notes)) = 7

Neither code works and i get this error: "Subquery returned more than
1 value. This is not permitted when the subquery follows =, !=, <, <=
, >, >= or when the subquery is used as an expression.
The statement has been terminated."


Since your UPDATE query cannot result in that error message, my
conclusion is that the table has a poorly written trigger, which assumes
that only one row at a time gets updated. You should probably locate
and fix that trigger.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinf...2000/books.asp
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Jason | last post by:
Let's say I have an html form with 20 or 30 fields in it. The form submits the fields via POST to a php page which updates a table in a database with the $_POST vars. Which makes more sense? ...
1
by: delta7 | last post by:
Hi, I'm new to C sharp and currently writing a small program that uses an Access 2003 database. I am currently having a problem when updating a row that includes numeric data. When updating...
9
by: Kevin Blount | last post by:
Here's the code I tried, and found it failed... <form runat="server" method="post" name="CreditCardForm" id="CreditCardForm"> <% foreach (object item in Request.Form) { if...
6
by: akoymakoy | last post by:
Run time error 3251 Current Recordset does not support updating, this may be a limitation of the provider, or of the selected Locktype This is my simple program that will split the entries that...
4
by: directory | last post by:
hey guys, I've got a weird one for ya....i have a form which takes user input in the form of textbox's etc. It then grabs some details from a file and updates some of the labels with some info...
9
by: Marianne160 | last post by:
Hi, I know there are various answers to this problem available on the web but none of them seem to work for me. I am using Access 2003 to make a form to look up data from a table. I have so far...
1
by: EyeHawk | last post by:
OK, hopefully somebody can help me out again. My next problem is updating 3 form fields (type list/menu option) that correspond to a date, one for month, one for day and one for year when the user...
23
vikas1111
by: vikas1111 | last post by:
Hi All.. I am accessing 2 colums from access database and updating them . Option Explicit Dim c As New adodb.Connection Dim cn As New adodb.Connection Dim cm As adodb.Command Dim rsnew2...
0
by: Mike | last post by:
So here's the situation (.NET 2.0 btw): I have a form, and on this form is a textbox among many other databound controls. The textbox is bound to a field in a data table via the Text property. ...
0
by: Dan | last post by:
Hi, I have a detailsview with two fields: in editmode, one is a textbox and the other is a dropdownlist. i want to update both fields using the detailsview. My problem: when clicking on the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
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.