Moving Tables between DBs

  • [font="Tahoma"]

    I need to move tables from one DB to another.

    I did the Export/Import task on the DB, and selected the proper tables,

    and it appeared to work fine, but then I found that all the PKs, IXs, Identity's, Default Values, etc. were gone.

    How do I move tables inbetween DBs and keep all the metadata? (SS2005)

    [/font]

  • Script out all your objects and then run them against your destination database.

  • [font="Tahoma"]Thanks, that worked great.

    I only really needed the metadata so it was perfect, but just to mess around I tried to export/import the data after I created the tables and it hung up on the primary key (Identity). Is there some easy way around this? I can see wanting to do this in the future.[/font]

  • Use ssis. You can use BI also to make the things easy for you.

    -MJ

    -MJ
    Please do not print mails and docx unless it is absolutely necessary. Spread environmental awareness.

  • You need to check for Indentity column. You need to see if the values are Identical in source table then ignore the field/column export to destination server. Identity column will automatically get populated.

  • all the pervious posts are great. Also, you simply use the script for export in steps of SSIS and schedule it to run on re-occurance.

    hope that helps

    Ellie

  • Just to add few more point , Export and Import wizard will copy only data apart from SPs, Functions . index , .triggers all needs to be scripted and created in destination tables

Viewing 7 posts - 1 through 6 (of 6 total)

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