Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Relations between different databases tables
Message
From
09/06/2003 08:26:05
 
 
To
09/06/2003 00:52:29
General information
Forum:
Microsoft SQL Server
Category:
Database design
Miscellaneous
Thread ID:
00797878
Message ID:
00797914
Views:
23
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
Previous
Reply
Map
View

Click here to load this message in the networking platform