Relationship with different databases | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Relationship with different databases

Hello, I’d like to know if it’s possible to relation 2 tables in different databases.
For example: Database A
Table: Address
Field: adCityCod (FK) Database B
Table: Cities
Field: ctCityCod (PK) Is it possible to create a reference between these tables? Tanx, Fernando
I think, this is Syntactically not possible. I hope someone will answer about this if he/she has solution. But we can use linked queries to link multiple linked servers, but can not set a relationship in between two databases. -Johnson

I think Johnson is right. Because even if you set a foreign key relation, you can relate two tables in two different databases if it is in the same server. If the two databases are in two different servers, we can use linked servers to link those databases. N.Babu Godson Samuel