Hi
I use one SQL database (caleed Db1) with a table called 'UnitData'.This table have a field called 'UnitId'
I would like to use the table 'UnitData' in a second database (called Db2) to enforce relationship inside this second db.
I create the following script to build a table that would use a foreign key to the UnitData table
Create Table BatchData
{
BatchId .....
BatchNbr blabla ...
UnitId int NOT NULL CONSTRAINT Fk_.... REFERENCES Db1..UnitData( UnitId)
...
}
I got the following error
Cross-database foreign key references are not supported
How could I do such thing using MS-SQL ?
Thanks for your help
Thierry
}
I use one SQL database (caleed Db1) with a table called 'UnitData'.This table have a field called 'UnitId'
I would like to use the table 'UnitData' in a second database (called Db2) to enforce relationship inside this second db.
I create the following script to build a table that would use a foreign key to the UnitData table
Create Table BatchData
{
BatchId .....
BatchNbr blabla ...
UnitId int NOT NULL CONSTRAINT Fk_.... REFERENCES Db1..UnitData( UnitId)
...
}
I got the following error
Cross-database foreign key references are not supported
How could I do such thing using MS-SQL ?
Thanks for your help
Thierry
}