Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2005
    Posts
    25

    Unanswered: Join two tables from different dbs

    Hi,

    have to tables t1 and t2
    t1 is in database db1
    t2 is in db db2

    Is it possible to join these two tables with an sql statement. or do i have to join my two datasets in my c#- Code

    Greetz

  2. #2
    Join Date
    Nov 2005
    Posts
    25
    Ok, can do it with 3 part naming.

  3. #3
    Join Date
    Feb 2003
    Posts
    19
    You can write the script as: Select * From DatabaseName.dbo.TableName

  4. #4
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    47
    select *
    from db1.dbo.t1 t1 inner join db2.dbo.t2 t2
    on t1.pk = t2.pk
    -----------------
    KH


Posting Permissions

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