ASA SQL Reference
System Procedures and Functions
System and catalog stored procedures
Populates the dbo.migrate_remote_table_list table.
sa_migrate_create_remote_table_list (
server_name,
[ table_name, ]
[ owner_name, ]
[ database_name ] )
None
None
sa_migrate_create_tables 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_remote_table_list 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 populates the dbo.migrate_remote_table_list table with a list of tables that can be migrated from the remote database. You can delete rows from this table for remote tables that you do not want to migrate.
If you do not want all the migrated tables to have the same owner on the target Adaptive Server Anywhere database, you must execute this procedure for each user whose tables you want to migrate.
As an alternative, you can migrate all tables in one step using the sa_migrate system procedure.
Caution Do not specify NULL for both the table_name and owner_name parameters. |
Supplying NULL for both the table_name and owner_name parameters migrates all the tables in the database, including system tables. As well, tables that have the same name, but different owners in the remote database all belong to one owner in the target database. It is recommended that you migrate tables associated with one owner at a time.
server_name The name of the remote server that is being used to connect to the remote database. The remote server is created with the CREATE SERVER statement. A value is required for this parameter.
For more information, see CREATE SERVER statement.
table_name The name(s) of the tables that you want to migrate, or NULL to migrate all the tables. The default is NULL. Do not specify NULL for both the table_name and owner_name parameters.
owner_name The user who owns the tables on the remote database that you want to migrate, or NULL to migrate all the tables. The default is NULL. Do not specify NULL for both the table_name and owner_name parameters
database_name The name of the remote database from which you want to migrate tables or NULL. This parameter is NULL by default. When migrating tables from Adaptive Server Enterprise and Microsoft SQL Server databases, you must specify the database name.
The following statement creates a list of tables that belong to all the users on the remote database.
CALL sa_migrate_create_remote_table_list( 'local_a', NULL, NULL, NULL )
The following statement creates a list of tables that belong to the user remote_a on the remote database.
CALL sa_migrate_create_remote_table_list( 'local_a', NULL, 'remote_a', NULL )
The following statement creates a list of tables that are in the database named mydb.
CALL sa_migrate_create_remote_table_list( 'local_a', NULL, NULL, 'mydb' )