you should be able to do something like this
 
SELECT
 table1.*,
 table2.*
FROM
 SQLSERVER_1.DATABASE_X.dbo.TABLE table1
  INNER JOIN SQLSERVER_2.DATABASE_Y.dbo.TABLE table2 ON table1.keyField = table2.keyField
 
please excuse the server, database, table and keynames and the selecting *, just wanted to be able to represent it
 
 
This was tested and works on sqlserver 2000, joining tables from dev to staging sql servers, which are physically separate machines.
-----Original Message-----
From: Adaryl Wakefield [mailto:[EMAIL PROTECTED]
Sent: Tuesday, December 02, 2003 12:35 PM
To: [EMAIL PROTECTED]
Subject: [KCFusion] system intergration

I was just curious how someone with more experience would do this.
 
I have three applications that run off three different databases. Which means three differnet passwords, three different logins yadda yadda yadda. Im in the middle of creating a system where everything is controlled by one username and password set. Im doing this by taking the three primary parent tables (is that even the correct term?) and combining common attributes. What remains of the primary parent tables of the three applications after stripping out common attributes will become conceputally child tables to the super table. The super table will be moved into another database making that 4 total.
Here is what im thinking. You cant join tables accross databases so what I was thinking was holding the primary key of the super table in a session var to join the three "child" tables. Like
 
test1 DB
members(memberID PK, firstName, lastName)
 
test2 DB
organizations(orgNum PK, memberID FK)
 
<cfquery name="foo" datasource="test2">
SELECT orgName
FROM organizations
WHERE orgNum = #session.memberID#
</cfquery>
<!---Just pretend the lock is there--->
 
Thoughts? Ridicule?
 
Adaryl Wakefield
Aviator by passion
Programmer by sheer force of will

Reply via email to