ASA SQL Reference
System Procedures and Functions
System and catalog stored procedures
Creates a proxy table and base table for each table listed in the dbo.migrate_remote_table_list table.
sa_migrate_create_tables ( local_table_owner )
None
None
sa_migrate_create_remote_table_list system procedure
sa_migrate_data system procedure
sa_migrate_create_remote_fks_list system procedure
sa_migrate_create_fks system procedure
sa_migrate_drop_proxy_tables system procedure
Migrating databases to Adaptive Server Anywhere
The sa_migrate_create_tables stored procedure is used with the other migration stored procedures. These procedures must be executed in the following order:
sa_migrate_create_remote_table_list
sa_migrate_create_tables
sa_migrate_data
sa_migrate_create_remote_fks_list
sa_migrate_create_fks
sa_migrate_drop_proxy_tables
This procedure creates a base table and proxy table for each table listed in the dbo.migrate_remote_table_list table (created using the sa_migrate_create_remote_table_list procedure). These proxy tables and base tables are owned by the user specified by the local_table_owner argument. This procedure also creates the same primary key indexes and other indexes for the new table that the remote table has in the remote database.
If you do want all the migrated tables to have the same owner on the target Adaptive Server Anywhere database, you must execute the sa_migrate_create_remote_table_list procedure and the sa_migrate_create_tables procedure for each user who will own migrated tables.
As an alternative, you can migrate all tables in one step using the sa_migrate system procedure.
local_table_owner The user on the target Adaptive Server Anywhere database who owns the migrated tables. This user is created using the GRANT CONNECT statement. A value is required for this parameter.
For more information, see GRANT statement.
The following statement creates a base tables and proxy tables on the target Adaptive Server Anywhere database. These tables belong to the user local_a.
CALL sa_migrate_create_tables( 'local_a' )