How to copy a table (with the data) from one server to another?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mikek12004
    New Member
    • Sep 2008
    • 200

    #16
    Try the import/export wizard, this will get you the data for sure if the restrictions re not copied you will have to do it manually with each table as said above,
    to copy table/data use
    Code:
    SELECT * INTO test.dbo.Table_1 FROM source.dbo.Table_1;
    and for the restriction the SQL will produce something like
    Code:
    ALTER TABLE test.dbo.Table_1 ADD CONSTRAINT PK_Table_1 PRIMARY KEY (id)

    Comment

    • JB Brossard
      New Member
      • Nov 2010
      • 1

      #17
      To copy data from one table to another where the tables are located in different databases (regardless of their type or location), you can use a tool called Data Moving Tool. It does exactly what you need.

      Comment

      Working...