How to copy / replace tables in MS SQL Server Management Studio 2005?
Posted on 2008-10-06
I develop against a test database and then move my changes to a live database - as probably do 95% of the rest of you out there! Back in the good ole days in previous versions of Enterprise manager, this was as simple as running the Export Data wizard, selecting your tables, telling it to copy indexes and PKs, and to replace the existing table.
But no - MS seems to have messed all this up in SQL MS 2005... or at least I can't figure out how to do it. When I run the export wizard it will not create any indexes or PKs on new tables, and if the old table does not match the structure of the current table, it just decides to ignore the new columns. Now if my "drop destination table first" option was not greyed out - that might work but I have never actually see it available.
How in the heck do we accomplish this simple, routine function with SQL 2005 without creating scripts, and then going back and exporting the data to the new tables. I have done this but this is a real PITA where for years it was a 2 minute point and click exercise.
Am I missing something or did Microsoft really mess this up?