Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
jogin malathi
Posting Yak Master
117 Posts |
Posted - 2007-04-09 : 01:43:06
|
| HiI have two database as Malathi,IndooIn Malathi database i have Employee Table AS----------------------Eid Int (PK)Enam varchar(50)In Indoo Database I have Job table asEid int (FK)Jid Int (PK)Now how can i create relation b/w two tables of different databaseAny One can help for this queryMalathi Rao |
|
|
PeterNeo
Constraint Violating Yak Guru
357 Posts |
Posted - 2007-04-09 : 02:46:02
|
| No, it is not possible to create foreign key relationship between tables in two different databases.According to BOL ( 2000)" A FOREIGN KEY constraint can reference columns in tables in the same database or within the same table " |
 |
|
|
jogin malathi
Posting Yak Master
117 Posts |
Posted - 2007-04-09 : 02:58:57
|
then how we use two different database without creating relationships b/w tablesquote: Originally posted by PeterNeo No, it is not possible to create foreign key relationship between tables in two different databases.According to BOL ( 2000)" A FOREIGN KEY constraint can reference columns in tables in the same database or within the same table "
Malathi Rao |
 |
|
|
khtan
In (Som, Ni, Yak)
17689 Posts |
Posted - 2007-04-09 : 03:03:43
|
use 3 part namingselect *from db1.dbo.tab1 t1 inner join db2.dbo.tab2 t2on t1.somecol = t2.somecol KH |
 |
|
|
|
|
|