I’m using SQL Server 2008.
Is it possible to create a script to loop over all tables in a database generating a set of index drop scripts and create scripts separately?
What I have to do is drop all indexes on a set of databases to run a heavy data load process but then I want to re-enable all the indexes. I don’t want to have to go through each table and script an index drop and then index create.
Yes. Someone’s already done it so no need to write a script again… 🙂
Drop All Indexes and Stats in one Script
Edit. Oops. To create…
Before you drop them… In SSMS, right-click, generate scripts, etc