When writing SQL for use on more than one database management system, make your SQL statements as explicit as possible. Even if more than one server supports a given SQL statement, it may be a mistake to assume that default behavior is the same on each system. General guidelines applicable to writing compatible SQL include:
Spell out all of the available options, rather than using default behavior.
Use parentheses to make the order of execution within statements explicit, rather than assuming identical default order of precedence for operators.
Use the Transact-SQL convention of an @ sign preceding variable names for Adaptive Server Enterprise portability.
Declare variables and cursors in procedures and batches immediately following a BEGIN statement. Sybase IQ requires this, although Adaptive Server Enterprise allows declarations to be made anywhere in a procedure or batch.
Do not use reserved words from either Adaptive Server Enterprise or Sybase IQ as identifiers in your databases.
Set the Sybase IQ database option PERCENT_AS_COMMENT OFF and use -- (double dash) as a comment delimiter for SQL/92 compatibility. The percent character is the default comment delimiter in IQ. Adaptive Server Enterprise treats the % as a modulo operator and does not support the IQ mod function.