When you create a cross-database constraint, the SAP ASE server stores information in the sysreferences system table of each database.
Information Stored in sysreferences |
Columns with Information About Referenced Table |
Columns with Information About Referencing Table |
---|---|---|
Key column IDs |
refkey1 through refkey16 |
fokey1 through fokey16 |
Table ID |
reftabid |
tableid |
Database name |
pmrydbname |
frgndbname |
Drop the referenced table,
Drop the external database that contains it, or
Use sp_renamedb to rename either database.
Use sp_helpconstraint to determine which tables reference the table you want to drop. Use alter table to drop the constraints before reissuing drop table.
You can drop a referencing table or its database. The SAP ASE server automatically removes the foreign-key information from the referenced database.
Each time you add or remove a cross-database constraint or drop a table that contains a cross-database constraint, dump both of the affected databases.