View Single Post

   
  #3 (permalink)  
Old 03-04-2008, 07:23 AM
Erland Sommarskog
 
Posts: n/a
Default Re: 512 error in delete statement

(phdscholar80@yahoo.com) writes:
> I have a piece of code that uses the db-library with sql server
> 2000/2005 and runs the following delete statement:


Beware that DB-Library is deprecated, and the version after SQL 2008
will not permit connections for DB-Library. Also, with DB-Library
you don't access to a lot of the new functionality added in SQL 7 and
later.

> on TABLE1, uploads data into TABLE1 through bulk loading, calls a
> stored procedure that uses the data, and then deletes the data through
> the SAME delete statement with EXACTLY the same parameter values. The
> first delete statement is always successful, but the second statement
> intermittently gives the following error:
>
>
>
> 0,0,MS SQL Server Message :
> SQL Server message 512, state 1, severity 16:
> Subquery returned more than 1 value. This is not permitted when the
> subquery follows =, !=, <, <= , >, >= or when the subquery is used as
> an expression.


As Dan said, the cause is likely to be found in a poorly written trigger.

--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx
Reply With Quote