SAP Knowledge Base Article - Preview

3318147 - Unexpected behavior from batch job when encountering error Msg 512 - SAP ASE


  • Simple query/batch job which runs several statements in a batch. 
  • The batch returns the following:
    Msg 512, Level 16, State 5
    Server 'servername', Line 3
    Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <= , >, >=, or when the subquery is used as an expression.
    Command has been aborted.
    (0 rows affected)
  • The problem is the remaining statements in the batch are executed, which is problematic because the remaining statements rely on the results of the failed portion of the query.



SAP Adaptive Server Enterprise (ASE) - all versions


SAP Adaptive Server Enterprise 15.7 ; SAP Adaptive Server Enterprise 16.0


KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , How To

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.