[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

joe

3/28/2007 12:07:00 AM

I am trying to pull together information from two different Linked Server
databases.

Let's call the LinkedServerA and LinkedServerB, both of which are Oracle
databases.

So, what I want to do is pull the following Columns from LinkedServerA:
ANUMBER, FNAME, LNAME, C_ID, S_ID, STATE

And from LinkedServerB I want to pull one Column
CCH

The Join is on LinkedServerA.ANUMBER = LinkedServerB.ANUM_EXTERN

For the life of me I can't get the statement correct.

Here's what I have
SELECT LSA.ANUMBER, LSA.FNAME, LSA.LNAME, LSA.C_ID, LSA.S_ID, LSA.STATE,
LSB.CCH
FROM LinkedServerA..ConnectingUser LSA
JOIN LinkedServerB..ConnectingUser LSB
ON LSA.STATE = LSB.ANUM_EXTERN
WHERE LSA.STATE = 'VALUE';

Where have I gone wrong?
1 Answer

Roy Goldhammer

3/28/2007 1:06:00 PM

0

try this instead:

SELECT LSA.ANUMBER, LSA.FNAME, LSA.LNAME, LSA.C_ID, LSA.S_ID, LSA.STATE,
LSB.CCH
FROM LinkedServerA.DBO.ConnectingUser LSA
JOIN LinkedServerB.DBO.ConnectingUser LSB
ON LSA.STATE = LSB.ANUM_EXTERN
WHERE LSA.STATE = 'VALUE';


"Joe" <Joe@discussions.microsoft.com> wrote in message
news:6F91358B-C071-4194-A88A-D92BC6366534@microsoft.com...
>I am trying to pull together information from two different Linked Server
> databases.
>
> Let's call the LinkedServerA and LinkedServerB, both of which are Oracle
> databases.
>
> So, what I want to do is pull the following Columns from LinkedServerA:
> ANUMBER, FNAME, LNAME, C_ID, S_ID, STATE
>
> And from LinkedServerB I want to pull one Column
> CCH
>
> The Join is on LinkedServerA.ANUMBER = LinkedServerB.ANUM_EXTERN
>
> For the life of me I can't get the statement correct.
>
> Here's what I have
> SELECT LSA.ANUMBER, LSA.FNAME, LSA.LNAME, LSA.C_ID, LSA.S_ID, LSA.STATE,
> LSB.CCH
> FROM LinkedServerA..ConnectingUser LSA
> JOIN LinkedServerB..ConnectingUser LSB
> ON LSA.STATE = LSB.ANUM_EXTERN
> WHERE LSA.STATE = 'VALUE';
>
> Where have I gone wrong?