When I try to run a particular stored procedure on my MS SQL 2005 database, I get an error like the following:
Subquery returned more than 1 value. This is not permitted when
the subquery follows =, !=, <, <= , >, >= or when the subquery
is used as an expression
The SP in query is very long and calls other SPs. This error is obviously being produced by SQL itself, and returned all the way up the call stack, but without mentioning which SP or line number caused the problem. How can I find out from where the error was thrown so I can debug it more easily?