SQL Server Performance

Error : Subquery return more that 1 value

Discussion in 'SQL Server 2008 General DBA Questions' started by michellesbs, Jan 13, 2012.

  1. michellesbs New Member


    I get an error message as below when run my program thru the ADO which is connect to SQL 2008 database, but when I copy the script and run that Store Procedure in SQL, there is no error occurs, hence I can't trace the error from where ....

    Is SQL handle the error ? Anywhere for me to trace the error come from ?

    Error message :
    "Subquery return more that 1 value. This is not permit when the subquery follow =, !=, <, <= or when the subquery is used as an expression. "

  2. MichaelB Member

    you must have a query like this

    select *
    from table1
    where id not in (select * from table2)

    it should only have 1 column in the subquery select. not more than one.

Share This Page