PERCENT_AS_COMMENT option [TSQL]

Function

Controls the interpretation of the percent (%) character.

Allowed values

ON, OFF

Default

ON

Description

By default, Sybase IQ treats the percent character as a comment marker. However, Sybase recommends that you do not use it as such; use one of the alternative comment markers such as //, /* */, or -- (double dash) instead. The double-dash style is the SQL92 comment delimiter.

Adaptive Server Enterprise treats the % as a modulo operator; it does not support the Sybase IQ mod function. You can set this option to OFF for compatibility with both environments.

Adaptive Server Anywhere treats the percent character exactly as Sybase IQ, that is, as comment by default, but as a modulo operator if you set the PERCENT_AS_COMMENT option to OFF.

Procedures and views created with %-style comments are converted to double-dash comments when they are stored in the catalog. The Sybase Central code editor does not highlight %-style comments. To have your comments highlighted, use one of the other comment delimiters.

NoteExisting procedures that contain %-style comments must be re-created before you change the option setting; otherwise, the procedures fail to load.