[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Update Help

Posted on 2005-05-03
4
Medium Priority
?
205 Views
Last Modified: 2010-03-19
The following statement is not working:  

update dbo.main
    set LastName = 'JOHNSTON'
     where  LastName = 'COFFMAN'


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.




0
Comment
Question by:wyclef
  • 2
4 Comments
 
LVL 10

Expert Comment

by:lengreen
ID: 13919346
Hi wyclef,

The statement on its own is fine, do you have an update trigger on dbo.main?

Cheers!
0
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13919347
Are you sure this is the whole statement you are trying to execute?  If not, please post the original UPDATE statement.
0
 

Author Comment

by:wyclef
ID: 13919454
lengreen,

You are right I have a trigger.  How to get around this without disabling the trigger?
0
 
LVL 10

Accepted Solution

by:
lengreen earned 200 total points
ID: 13919570
wyclef,

Good Question, Updating of surnames would be quite common (IMO) , without knowing what the trigger does , I would suggest editing your trigger to ensure you only return one row in your subquery

cheers
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
An alternative to the "For XML" way of pivoting and concatenating result sets into strings, and an easy introduction to "common table expressions" (CTEs). Being someone who is always looking for alternatives to "work your data", I came across this …
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
Suggested Courses

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question