Wednesday, March 28, 2012

Relationship to table in another DB possible?

Is it possible to create a relationship to a table in another database,
either on the same server or a linked server?
- DaveHi
Foreign Keys are not possible across databases, you can create a check
constraint that calls a function (which may prove slow!) or enforce the
constraint in a trigger.
John
"David Slinn" <dslinn@.accesscomm.ca> wrote in message
news:eSZJ5e%23oEHA.1588@.TK2MSFTNGP09.phx.gbl...
> Is it possible to create a relationship to a table in another database,
> either on the same server or a linked server?
> - Dave
>|||Creating a foreign key across databases is not possible; however, you can
enforce cross-database relationships using triggers.
"David Slinn" <dslinn@.accesscomm.ca> wrote in message
news:eSZJ5e%23oEHA.1588@.TK2MSFTNGP09.phx.gbl...
> Is it possible to create a relationship to a table in another database,
> either on the same server or a linked server?
> - Dave
>

No comments:

Post a Comment