Linking two databases and copying details to third database

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hatrick
    New Member
    • Feb 2008
    • 5

    Linking two databases and copying details to third database

    Hi ,

    there is one table (T1) in database DB1, another table T2 in DB2 , i want to run a query which select data from these two tables and copy/ place this data into third table T3 in DB3.

    All Databases are residing in different servers.

    i tried sp_addlinkedser ver, but unable to solve the problem.

    can anybody please tell me the steps to be follow to solve this problem.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Did you run the query from DB3 ?

    Comment

    • hatrick
      New Member
      • Feb 2008
      • 5

      #3
      I need to run query in DB3,

      linking the two databases(in diff. servers) will only resolve the issue.

      if i take another path like
      copy the ID, nad other needed data in temporary table in DB2 and then selecting data from the two tables(which now be in same database) can be done .

      but it involves copying huge amount of data in live server and then again selecting copying data to third server's database(which is very time consuming)

      please guide me as i am novice player in this area.

      tnx.

      Comment

      • ck9663
        Recognized Expert Specialist
        • Jun 2007
        • 2878

        #4
        If this is a one time thing, just use DTS and transfer all the tables you need from DB1 and DB2 into DB3, then do your query in DB3. If this is more of recurring thing, you're right, you have to link the server. Could you post here what you have done so far?

        -- CK

        Comment

        • hatrick
          New Member
          • Feb 2008
          • 5

          #5
          this is gotng to be a regular thing on daily basis.

          i tried to link the server , but its not linking.
          I tried to link server in Security ->Linked server in enterprise manager.

          but its not working , means i can see the servers in the list but i cannot work.( i am lost)

          please illustrate the steps and if possible the code used and where to write that code would be very greatful.

          please help me as i have just started working in SQL 2000.

          Comment

          • ck9663
            Recognized Expert Specialist
            • Jun 2007
            • 2878

            #6
            Have you tried this ?

            -- CK

            Comment

            Working...