locked
query on multiple databases RRS feed

  • Question

  • User-220722638 posted

    How do i query into multiple database and return results based on SSN? I am using visual studio and i have connection string for SQL and Access in webconfig.

    Access:
    Database Name: User data.mdb
    table: UserInformation
    field: SSN
    field: Dept

    SQL:
    Database name: sql2.UserTracking.dbo
    table: User_Info
    field:SSNO
    field: FIRST NAME

    Tuesday, May 1, 2012 12:35 PM

Answers

  • User-808732501 posted

    select  *
    from    User data.dbo.UserInformation as t1
    inner join
            sql2.UserTracking.dbo.User_Info as t2
    on      t1.SSN = t2.SSNO

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 2, 2012 4:59 AM

All replies

  • User-1407477457 posted

    Set up linked tables to the sql db in your access db.

    Tuesday, May 1, 2012 12:47 PM
  • User-808732501 posted

    select  *
    from    User data.dbo.UserInformation as t1
    inner join
            sql2.UserTracking.dbo.User_Info as t2
    on      t1.SSN = t2.SSNO

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, May 2, 2012 4:59 AM