Home » Topic » Move table form one database to another database in SQL

Move table form one database to another database in SQL

Stephen West ~ Modified: November 23rd, 2015 ~ ~ 1 Minute Reading

Home Forums Move table form one database to another database in SQL

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #917 Score: 0
    Andrew Jackson
    Moderator
    1 pt

    Try this:

    SELECT * 
    INTO DestinationDB..MyDestinationTable 
    FROM SourceDB..MySourceTable 

    It will not copy constraints, defaults or indexes.

    #918 Score: 0
    Lincoln Burrows
    Moderator
    16 pts

    Use Generate SQL Server Scripts Wizard to help guide the creation of SQL script’s that can:

    • copy the table schema
    • any constraints (identity, default values, etc)
    • data within the table
    • and many other options

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.