Click here to Skip to main content
12,548,135 members (48,168 online)
Rate this:
Please Sign up or sign in to vote.
See more: SQL-Server
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Is there a way to check which subquerry returns more than one value?
Posted 8-Oct-12 18:53pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use In Instead of =

i believe your query will look like this
Select * from tbl1 where col1=(select col1 from tbl2)

Use In operator here
Select * from tbl1 where col1 in (select col1 from tbl2)
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

You have to execute each sub-query to know which returns more than one row.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.161021.1 | Last Updated 9 Oct 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100