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