Run-Time Error -2147467259 : Subquery returned more than 1 value

Posted on 2006-05-25
Last Modified: 2008-01-09
On some code written by someone else and a stored procedure written by yet another person, I am getting run-time error -2147467259 that says "Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression."

<code removed per request http:Q_21903646.html>

If I run the SP in Query Analyzer, it returns one row with two columns (each column header says "(no column name)", not sure if that matters):

0 | NULL

Question by:GivenRandy
    LVL 6

    Accepted Solution


    Have you checked what DPI_ProcessStat stored procedure is doing. This is probably where the error is occurring as the EXEC statement is trying to assing the result of DPI_ProcessStat into variable @RC but if DPI_ProcessStat is returning more than one value then an error will occur.

    HTH :)
    LVL 9

    Author Comment

    It must have to do with the VB6 debugging / timing. In one application, it fails about half the time. In another, it fails every time. Both call the same class (that calls the stored procedure) with nearly identical data.

    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

    Join & Write a Comment

    Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
    Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
    As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
    This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

    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

    16 Experts available now in Live!

    Get 1:1 Help Now