When you create a cross-database constraint, the SAP ASE server stores information in the sysreferences table of each database.
Information Stored in sysreferences |
Columns with Information About the Referenced Table |
Columns with Information About the Referencing Table |
---|---|---|
Key column IDs |
refkey1 through refkey16 |
fokey1 through fokey16 |
Table ID |
reftabid |
tableid |
Database ID |
pmrydbid |
frgndbid |
Database name |
pmrydbname |
frgndbname |
When you drop a referencing table or its database, the SAP ASE server removes the foreign-key information from the referenced database.
Drop the referenced table,
Drop the external database that contains the referenced table, or
Rename either database with sp_renamedb.
You must first use alter table to remove the cross-database constraint.
Each time you add or remove a cross-database constraint, or drop a table that contains a cross-database constraint, dump both the affected databases.
The sysreferences system table stores the name and the ID number of the external database. The SAP ASE server cannot guarantee referential integrity if you use load database to change the database name or to load it onto a different server.