How to use DELETE  command in  SQL SERVER 2005

Posted on 2008-11-04
Last Modified: 2008-11-06

I would like to do the following:
WHERE STRM IN ('1092')

I get the following error:
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.

This was not an issue in the previous version of sql server.

I have tried to do what is in the help files but nothing is working.  

Any assistance would be greatly appreciated,

Question by:Lucia
    LVL 60

    Expert Comment

    Are you sure you posted your actual query?
    LVL 39

    Accepted Solution

    Perhaps you are doing:

    WHERE STRM =('1092')

    and '1092' is populated by building a dynamic Query string and in some cases it build a query like this.

    DELETE FROM PS_NCSR6200 WHERE STRM =('1092', '1024')
    ^^ THIS will NOT work.  But I can assure you that what you posted is valid SQL.


    Author Comment

    Ok,  I found out what the issue is.  The table had a trigger and that is why I was having problems perrfoming the command.

    Thanks to both for your quick response.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
    So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

    761 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

    7 Experts available now in Live!

    Get 1:1 Help Now