SAP Knowledge Base Article - Preview

1922501 - Error 156 for query that uses column alias in subquery - ASE


  • Stored procedures with the following pattern of subquery sql, fail on ASE 15.0.3 and ASE 15.5.

if not exists
select t1.c1, t2.c2 c3
from table1 t1, table3 t3, table2 t2
where t1.c4 = t3.c4
and t2.c4 = t1.c1
and t3.c4 = @c4

  • The error received is:

Msg 156, Level 15, State 68:
Server 'server_name', Procedure 'dbo.p_prod', Line 42:
Incorrect syntax near the keyword 'AS'.

  • The procedures work fine on ASE v15.7.



  • Sybase Adaptive Server Enterprise (ASE) 15.0.3
  • Sybase Adaptive Server Enterprise (ASE) 15.5
  • SAP Adaptive Server Enterprise (ASE) 15.7


SAP Adaptive Server Enterprise 15.7 ; Sybase Adaptive Server Enterprise 15.0 ; Sybase Adaptive Server Enterprise 15.5


Msg 156, subquery, alias , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , Problem

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.