Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Join between tables in different databases

 
Billy Tobon
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I need to make a join between two tables but they are in different databases (in slqserver2000), I found a ".relation" in c#, but want to use JDBC. There is any solution or workaround?

Billy
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I've done it in plain old SQL in MySQL using schema1.table1.attribute and schema2.table2.attribute, but in the end I found it easier to dump the table and import it into the other schema. All depends on your requirements. I was just doing some fairly basic (once-off) data conversion.

Actually I think from memory the table is still there...
 
Phillip Koebbe
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In a standard SQL query, it would look something like



As with most of my replies, this is from the hip, but I think it's close. If you are querying with sa or equivalent rights, you don't need the owner, but you still need the dot, so it becomes Database2..t_Table2.

Peace,
Phillip
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic