Help to copy tables from a database

  • Hy.

    I want to copy all the tables from a database to another, but leave the old stored procedures and functions.

    If I use back up's I can't select to restore only the tables.

    I can't use import data because I need to keep all the primary , foreign keys, autoincrement columns etc.

    Help 🙂

  • Script the tables and create them in the destination database, then use the Import/Export Wizard to copy the data. Or create an SSIS package with a Transfer SQL Server Objects Task.

    Greg

  • If I have an autoincrement column (is identity) the import/export wizard raise an error.

  • For the tables that have identity columns, click on the "Edit Mappings..." button in the Wizard and check the "Enable identity insert box. This will disable the identity increment on the destination table and insert the values from the source table.

    Greg

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply