7

Is it possible to create a Database Diagram involving two databases in the same SQL Server project? I have a table in one database that I want to create a foreign key to another table in another database.

I'm using MS SQLServer 2008 R2.

The Student
  • 27,520
  • 68
  • 161
  • 264
Al Lelopath
  • 6,448
  • 13
  • 82
  • 139
  • I assume you mean in SSMS, and I believe the answer is no. – Kermit Apr 10 '13 at 16:50
  • Since you [can't](http://stackoverflow.com/questions/5166641/sql-server-foreign-keys-across-database-boundaries-techniques-for-enforcement) create a foreign key that references another database, I'm not sure what your goal is here. – Pondlife Apr 10 '13 at 17:12
  • You cannot in SSMS, yet. You would need a third party tool. I'm sorry I can't offer any suggestions tho. – M Kenyon II Dec 07 '16 at 15:37

1 Answers1

4

The only way to do it would be to create, in one database, empty surrogates for the tables in the other database, then create the diagram using the surrogates... You might want to put these surrogates in a schema that identifies them as surrogates for the actual tables in the other DB.

Charles Bretana
  • 143,358
  • 22
  • 150
  • 216