Contents Index sa_migrate system procedure sa_migrate_create_remote_fks_list system procedure

ASA SQL Reference
  System Procedures and Functions
    System and catalog stored procedures

sa_migrate_create_fks system procedure


Function 

Creates foreign keys for each table listed in the dbo.migrate_remote_fks_list table.

Syntax 

sa_migrate_create_fks ( local_table_owner )

Permissions 

None

Side effects 

None

See also 

sa_migrate system procedure

sa_migrate_create_remote_table_list system procedure

sa_migrate_create_tables system procedure

sa_migrate_data system procedure

sa_migrate_create_remote_fks_list system procedure

sa_migrate_drop_proxy_tables system procedure

Migrating databases to Adaptive Server Anywhere

Description 

The sa_migrate_create_fks stored procedure is used with the other migration stored procedures. These procedures must be executed in the following order:

  1. sa_migrate_create_remote_table_list

  2. sa_migrate_create_tables

  3. sa_migrate_data

  4. sa_migrate_create_remote_fks_list

  5. sa_migrate_create_fks

  6. sa_migrate_drop_proxy_tables

This procedure creates foreign keys for each table that is listed in the dbo.migrate_remote_fks_list table. The user specified by the local_table_owner argument owns the foreign keys in the target database.

If the tables in the target Adaptive Server Anywhere database do not all have the same owner, you must execute this procedure for each user who owns tables for which you need to migrate foreign keys.

As an alternative, you can migrate all tables in one step using the sa_migrate system procedure.

Parameters 

local_table_owner    The user on the target Adaptive Server Anywhere database who owns the migrated foreign keys. If you want to migrate tables that belong to different user, you must execute this procedure for each user whose tables you want to migrate. The local_table_owner is created using the GRANT CONNECT statement. A value is required for this parameter.

For more information, see GRANT statement.

Example 

The following statement creates foreign keys based on the dbo.migrate_remote_fks_list table. The foreign keys belong to the user local_a on the local Adaptive Sever Anywhere database.

CALL sa_migrate_create_fks( 'local_a' )

Contents Index sa_migrate system procedure sa_migrate_create_remote_fks_list system procedure