I would like to know if a Database Schema Migration Script (generated by Visual Studio 2008 or greater) will run faster if my target database got indexes rebuilt and/or reorganized.

Note: For all tables, when index fragmentation level is between 5% and 30% I reorganize the index. When index index fragmentation level is above 30% I rebuild the index.

Note 2: Database schema migration script generated by Visual Studio has a lot of commands to alter table structure, add constraints, foreing keys and indexes in order to keep target database structure updated/syncronized with files contained in our Database project (.dbproj file).


If you are just migrating the Schema itself, and not any of the data, Index Fragmentation of your user database tables should be irrelevant. The instructions in the migration script will come from system database tables holding the metadata for your user database/schema.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.