SAP Knowledge Base Article - Preview

2421236 - Syntax error near 'ORDER' when ORDER BY used with FOR XML in subquery


ASE reports a syntax error near 'ORDER' when an ORDER BY clause is used with FOR XML in subquery


'Msg 156, Level 15, State 68:
Server 'sybase', Line 1:
Incorrect syntax near the keyword 'ORDER'.



  • SAP Adaptive Server Enterprise (ASE) 16.0 SP02 PL05 and higher (query works in earlier versions)
  • SAP Adaptive Server Enterprise Cluster Edition (ASE CE)


SAP Adaptive Server Enterprise 16.0


Sybase, ASEServer, SAPASE, dataserver, XML, ORDER, subquery, syntax, 156   , KBA , BC-SYB-ASE , Sybase ASE Database Platform (non Business Suite) , BC-SYB-ASE-CE , ASE Cluster Edition (Standalone) , Bug Filed

About this page

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

Search for additional results

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