Subquery returned more than 1 value

Problem:

File: e:pt84915b-retailpeopletoolssrcpsappengaedebug.hSQL error. Stmt #: 16
 03 Error Position: 0 Return: 8601 - [Microsoft][SQL Native Client][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.
 [Microsoft][SQL Native Client][SQL Server]The statement has
 Failed SQL stmt:UPDATE PS_PTPP_OPTIONS SET PTPP_REG_PREFIX = 
( SELECT A1.EOPP_REG_PREFIX FROM PS_EOPP_OPTIONS A1)
 Message Set Number: 200
 Message Number: 0
 Message Reason: File: e:pt84915b-retailpeopletoolssrcpsappengaedebug.hSQL
 error. Stmt #: 1603 Error Position: 0 Return: 8601 - [Microsoft][SQL Native Client][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.
 [Microsoft][SQL Native Client][SQL Server]The statement has
 Failed SQL stmt:UPDATE PS_PTPP_OPTIONS SET PTPP_REG_PREFIX = 
( SELECT A1.EOPP_REG_PREFIX FROM PS_EOPP_OPTIONS A1) (200,0)
Process 7113 ABENDED at Step UPGPT846PP.EO_TO_PT.Step51a (SQL) -- RC = 8601 (108,524)
 Message Set Number: 108
 Message Number: 524
 Message Reason: Process 7113 ABENDED at Step UPGPT846PP.EO_TO_PT.Step51a (SQL)
 -- RC = 8601 (108,524)
Process %s ABENDED at Step %s.%s.%s (Action %s) -- RC = %s

Solution:

Ran:

SELECT * FROM PS_EOPP_OPTIONS A1
Two rows returned. Ran:

SELECT DISTINCT * FROM PS_EOPP_OPTIONS A1
One row returned.

Checked PS_EOPP_OPTIONS table in FSDEMO. It has one row.

Solution: Delete duplicate row:

SET ROWCOUNT 1
DELETE FROM [FSDMO].[dbo].[PS_EOPP_OPTIONS]

Leave a Comment


NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>


This site uses Akismet to reduce spam. Learn how your comment data is processed.