Update Help

Posted on 2005-05-03
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.

Question by:wyclef
    LVL 10

    Expert Comment

    Hi wyclef,

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

    LVL 28

    Expert Comment

    Are you sure this is the whole statement you are trying to execute?  If not, please post the original UPDATE statement.

    Author Comment


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

    Accepted Solution


    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


    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    Join & Write a Comment

    This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
    The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
    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
    Via a live example, show how to setup several different housekeeping processes for a SQL Server.

    729 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

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now