Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2004
    Posts
    2

    Unanswered: connecting to 2 databases inside one query

    hi there,
    I saw a similar thread before but i've tried it and no luck. I want run a query off a database (stawebdata.branchinfo) then a join into bluepages.phonelist

    i've tired

    JOIN bluepages.phonelist p

    Incorrect syntax near the keyword 'JOIN'.

    any ideas... is this possible?

    complete code below:

    select DISTINCT b.name, b.tel1, b.id, b.telprivate,b.sc, b.manager,b.branchEmail
    from branchInfo b
    inner
    JOIN bluepages.phonelist p on b.name = p.subdepartment
    where b.name like 'Sarah' or b.id LIKE '%@keyword%' OR b.county LIKE '%@keyword%' OR b.Area LIKE '%@keyword%' OR b.Manager LIKE '%@keyword%' OR b.AssistantManager LIKE '%@keyword%' OR b.Postcode LIKE '%@keyword%' OR b.PseudoCity LIKE '%@keyword%' OR b.TicketingTA LIKE '%@keyword%' OR b.SLC LIKE '%@keyword%' OR b.ItineraryTA LIKE '%@keyword%' OR b.TIDS LIKE '%@keyword%' OR b.ABTA LIKE '%@keyword%' and
    p.department = 'UK Branch' and
    b.isbranch <> 'False' or
    (p.lastName = '@keyword' or p.firstname = '@keyword')
    order by b.name asc
    GO
    Last edited by casperorg; 09-16-04 at 11:55.

  2. #2
    Join Date
    Sep 2004
    Posts
    2

    got it

    you have to put

    JOIN bluepages.dbo.phonelist

    i thought "dbo" was a param!


    derrr

  3. #3
    Join Date
    Feb 2002
    Location
    Assam, India
    Posts
    55

    Smile

    How about putting two dots:

    JOIN bluepages..phonelist


    Roshmi Choudhury

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •