title: What are the problems with a join between two tables in two different databases?
body: <p>I am interested in your thoughts about the the pitfalls of joining two or more tables from different databases. I'll try to give an example.</p>
  
  <p>Suppose table <code>Table1</code> is located in <code>DatabaseA</code> database and <code>Table2</code> is located in <code>DatabaseB</code> . 
  Let's say i have a view, in <code>DatabaseA</code> that pulls out some data from <code>Table1</code>, and some other tables in <code>DatabaseA</code>'. </p>
  
  <p>This view is used to push data to another database, let's call this one, unimaginatevely, <code>DatabaseC</code>.</p>
  
  <p>If i need some data from <code>Table2</code>, my instinct is to join directly <code>Table2</code> in this view, sort of like this <code>table1 inner join DatabaseB..table2 on [some columns]</code> </p>
  
  <p>Doing this is pretty simple and quick, but i have a nagging voice in my head that keeps telling me not to do this. My worries are about not being able to track down all the objects depending on <code>Table2</code>, so if I change something there, I have to be very carefull and remember everywhere i use this table. So, sort of like breaking SRP for this view (and two databases), because this view can change from two different actions (performed on two different databases: Changing <code>Table1</code> or changing <code>Table2</code>)</p>
  
  <p>I am interested in your opinions. Is this a good or bad idea? What would be the problems with this approach (performance wise, maintainence wise and so on) and if you have a real world experience where this approach either was a big mistake or was a life saver for you.</p>
  
  <p>P.S: I've searched this topic on google and SO, but could not find anything related to this. I will gladly take the minus votes, duplicate questions and other 'reprimands' from SO users just to have a different view on this problem.</p>
  
  <p>P.P.S: I am using SQL Server 2005.</p>
  
  <p>Thank you and hope i made myself clear:)</p>