ASA SQL User's Guide
Transact-SQL Compatibility
Configuring databases for Transact-SQL compatibility
This section describes choices you must make when creating or rebuilding a database.
Here are the steps you need to take to create a Transact-SQL-compatible database. The remainder of the section describes which options you need to set.
To create a Transact-SQL compatible database (Sybase Central)
Start Sybase Central.
Choose Tools
Follow the instructions in the wizard.
When you see a button called Emulate Adaptive Server Enterprise, click it, and then click Next.
Follow the remaining instructions in the wizard.
To create a Transact-SQL compatible database (Command line)
Enter the following command at a system prompt:
dbinit -b -c -k db-name.db
For more information about these options, see Initialization utility options.
To create a Transact-SQL compatible database (SQL)
Connect to any Adaptive Server Anywhere database.
Enter the following statement, for example, in Interactive SQL:
CREATE DATABASE 'db-name.db' ASE COMPATIBLE
In this statement, ASE COMPATIBLE means compatible with Adaptive Server Enterprise.
By default, string comparisons in Adaptive Server Enterprise databases are case sensitive, while those in Adaptive Server Anywhere are case insensitive.
When building an Adaptive Server Enterprise-compatible database using Adaptive Server Anywhere, choose the case sensitive option.
If you are using Sybase Central, this option is in the Create Database wizard.
If you are using the dbinit command-line utility, specify the -c
command-line switch.
When building an Adaptive Server Enterprise-compatible database using Adaptive Server Anywhere, choose the option to ignore trailing blanks in comparisons.
If you are using Sybase Central, this option is in the Create Database wizard.
If you are using the dbinit command line utility, specify the -b
command-line switch.
When you choose this option, Adaptive Server Enterprise and Adaptive Server Anywhere considers the following two strings equal:
'ignore the trailing blanks ' 'ignore the trailing blanks'
If you do not choose this option, Adaptive Server Anywhere considers the two strings above different.
A side effect of this choosing this option is that strings are padded with blanks when fetched by a client application.
Older versions of Adaptive Server Anywhere employed two system views whose names conflict with the Adaptive Server Enterprise system views provided for compatibility. These views include SYSCOLUMNS and SYSINDEXES. If you are using Open Client or JDBC interfaces, create your database excluding these views. You can do this with the dbinit -k
command-line switch.
If you do not use this option when creating your database, the following two statements return different results:
SELECT * FROM SYSCOLUMNS ; SELECT * FROM dbo.syscolumns ;
To drop the Adaptive Server Anywhere system views from an existing database
Connect to the database as a user with DBA authority.
Execute the following statements:
DROP VIEW SYS.SYSCOLUMNS ; DROP VIEW SYS.SYSINDEXES
Caution Ensure that you do not drop the dbo.syscolumns or dbo.sysindexes system view. |