These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Join tables from 2 different databases
PostPosted: Thu Feb 14, 2008 5:59 am 
Newbie

Joined: Thu Feb 14, 2008 5:34 am
Posts: 8
I wonder if it's possible to join 2 or more tables from 2 different databases.
I have two MS SQL 2005 databases and it's not possible to put them in one database, but some tables from the 2 databases are related.
I can't find this issue in the manual, so I think it's not possible or am I wrong?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 1:01 pm 
Newbie

Joined: Wed Jan 30, 2008 4:43 pm
Posts: 9
Location: Bend, OR
I haven't tried with NHibernate, but I know with sql you can do this:

select * from database1.dbo.tableA a inner join database2.dbo.tableB b on a.id = b.id

Therefore you might be able to add a mapping with table="database2.dbo.tableB". (or even table="database2..tableB".) If this does work it might only work on SQL Server.


Last edited by DavidHogue on Thu Feb 14, 2008 1:05 pm, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 14, 2008 1:04 pm 
Newbie

Joined: Wed Jan 30, 2008 4:43 pm
Posts: 9
Location: Bend, OR
Sorry, double posted.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.