Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. copy data between 2 instances

copy data between 2 instances

Scheduled Pinned Locked Moved Database
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Ista
    wrote on last edited by
    #1

    select * INTO [Instance1].targetDB.dbo.TargetTable from [Instance2].SourceDB.dbo.SourceTable What I would like to do is copy the table from one instance to another. How do I specify copying from one instance to another. I have already created the database. The target is Sql 2000 and I have full control. The source is Sql 2005 and I have only select permissions. How would I forulate a correct select into statement? Thanks, Nick

    -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

    K 1 Reply Last reply
    0
    • I Ista

      select * INTO [Instance1].targetDB.dbo.TargetTable from [Instance2].SourceDB.dbo.SourceTable What I would like to do is copy the table from one instance to another. How do I specify copying from one instance to another. I have already created the database. The target is Sql 2000 and I have full control. The source is Sql 2005 and I have only select permissions. How would I forulate a correct select into statement? Thanks, Nick

      -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

      K Offline
      K Offline
      kubben
      wrote on last edited by
      #2

      It should be an insert statement Insert into [Instance1].targetDB.dbo.TargetTable select * from [Instance2].SourceDB.dbo.SourceTable Hope that helps. Ben

      I 1 Reply Last reply
      0
      • K kubben

        It should be an insert statement Insert into [Instance1].targetDB.dbo.TargetTable select * from [Instance2].SourceDB.dbo.SourceTable Hope that helps. Ben

        I Offline
        I Offline
        Ista
        wrote on last edited by
        #3

        the problem is, how do I specify the Instances because "[Instance2].SourceDB.dbo.SourceTable" doesn't work. It has too many qualifiers. I think I add a linked server on my side. But how do I specify in one line which instance to use?

        -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

        K C 2 Replies Last reply
        0
        • I Ista

          the problem is, how do I specify the Instances because "[Instance2].SourceDB.dbo.SourceTable" doesn't work. It has too many qualifiers. I think I add a linked server on my side. But how do I specify in one line which instance to use?

          -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

          K Offline
          K Offline
          kubben
          wrote on last edited by
          #4

          Your [Instance2] includes the sqlserver name right? You know it might just be easier to DTS the table that is the way I do most of my table moving. Then you don't need to worry about link servers or any of that. It is the Import export Data. If you have access to sql server 2005 management studio, you go to the database you want to export a table from right click -> tasks -> export data. Then you just need to enter your destination sql server and database. Then select the table you want to copy. Hope that helps. Ben

          1 Reply Last reply
          0
          • I Ista

            the problem is, how do I specify the Instances because "[Instance2].SourceDB.dbo.SourceTable" doesn't work. It has too many qualifiers. I think I add a linked server on my side. But how do I specify in one line which instance to use?

            -------------------------------------------------------- 1 line of code equals many bugs. So don't write any!! My mad coder blog

            C Offline
            C Offline
            Colin Angus Mackay
            wrote on last edited by
            #5

            You need to link the two instances together before you can do that. See: sp_addlinkedserver in the books online.


            Upcoming events: * Edinburgh: Web Security Conference Day for Windows Developers (12th April) * Glasgow: Introduction to AJAX (2nd May), SQL Server, Mock Objects My website

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups