March 9, 2010 at 3:31 am
If i have a table on database A and one of the keys is called PErsonID and if for some reason I have a table on database B which also uses PersonID as well. How can I ensure referrential integrity bearing in mind that both tables are across different databases.
Any ideas ?
March 9, 2010 at 3:41 am
A trigger.
Foreign key constraints cannot reference objects in other databases so to do cross-DB referential integrity you need triggers.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
March 9, 2010 at 4:17 am
Thanks for the reply, is that the best way to do it, how about functions that are part of a check constraint, returns a bit. is that better ?
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply