Cross Database Foreign key

Who is online?  72 guests and 0 members
home  »  forums   »  sqlservergeeks community   »  general discussions   » Cross Database Foreign key

Cross Database Foreign key

Topic RSS Feed

Posts under the topic: Cross Database Foreign key

Posted: 9/21/2011 9:19:37 AM

Lurker 2  points  Lurker
  • Joined on: 7/30/2011 12:05:39 PM
  • Posts: 1

I have two database Named DB1 and DB2

In db1 i have created a table

create table db1.dbo.dept (deptid int primary key,deptname nvarchar(50) not null)

In db2 I want to create a table

create table db2.dbo.employee (employeeid int primary key,

deptid int foreign key references db1.dbo.dept(deptid))

It gives the error Cross database foreign key not supported

I want to create cross database foreign key and enforce the constraint against insert,update and delete

 


Posted: 9/21/2011 1:49:59 PM

Lurker 2  points  Lurker
  • Joined on: 3/15/2011 5:29:11 AM
  • Posts: 1
Can be done by creating database links , I haven't tried but have a concept and I think it should work More details @ http://www.dba-oracle.com/t_create_database_link_oracle.htm -Gaurav +91-986-888-0002
Page 1 of 1 (2 items)