User's Guide
PART 5. The Adaptive Server Family
CHAPTER 30. Transact-SQL Compatibility
In addition to supporting Transact-SQL alternative syntax, Adaptive Server Anywhere provides aids for translating statements between the Watcom-SQL and Transact-SQL dialects. The following functions return information about SQL statements and enable automatic translation of SQL statements:
SQLDialect(statement) Returns Watcom-SQL or Transact-SQL.
WatcomSQL(statement) Returns the Watcom-SQL syntax for the statement.
TransactSQL(statement) Returns the Transact-SQL syntax for the statement.
These are functions, and so can be accessed, for example, using a select statement from Interactive SQL. For example, the following statement:
select SqlDialect('select * from employee')
returns the value WatcomSQL.
Sybase Central has facilities for creating, viewing, and altering procedures and triggers.
Connect to a database using Sybase Central, either as owner of the procedure you wish to change, or as a DBA user.
Double-click the Procedures folder for the database to list the stored procedures in the database.
Using the right mouse button, click the procedure you wish to translate, and choose the dialect you wish to translate it to from the popup menu: either Watcom-SQL or Transact-SQL.
The procedure is displayed in the selected dialect. If the selected dialect is not the one in which the procedure is stored, it is translated to that dialect by the server. Any untranslated lines are displayed as comments.
Rewrite any untranslated lines as needed, and click the Execute Script button to save the translated version to the database. You can also export the text to a file for editing outside Sybase Central.