Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Relations between different databases tables
Message
De
09/06/2003 08:26:05
 
 
À
09/06/2003 00:52:29
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Conception bases de données
Divers
Thread ID:
00797878
Message ID:
00797914
Vues:
22
You can't stretch a FK constraint across databases. You're going to have to use a trigger.

-Mike

>Hi
>
>I need to create a relation between different databases tables, for example: the "crm" database table "suppliers" with the "inventory" database table "orders":
>
>ALTER TABLE orders ADD CONSTRAINT FK_suppliers_orders FOREIGN KEY (supli_id) REFERENCES crm.dbo.suppliers(supli_id)
>
>But if I use that sentence I get an error.
>
>Could you give an idea to deal with this problem?. The tables are organized in different databases, because the main database "crm" has the definitions tables that are commons for the others, for example, the table suppliers of "crm" database is common for the database "inventory_company_a", "inventory_company_b", "accounting_company_a", "accounting_company_b", ......, so, I need to keep the integrity, I can´t delete a supplier involved for example, in "orders" in "inventory_company_a" and in "accountig_company_b".
>
>Thank you
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform