skip to the main content area of this page
Search Script Archive 
Transact SQL scripts written by
DBAs and Developers for
DBAs and Developers.

To submit a comment about this script click here here or to submit your own script click here.

clear out DTA indexes and statistics
Description:
When the Database Tuning Advisor fails or is aborted for whatever reason, it can leave behind its hypothetical indexes and stats. This script will remove these active indexes and stats from your database. Uses the is_hypothetical flag to find indexes. Uses the _dta prefix to find stats. This assumes that when you implement DTA-recommended stats, you change their name. If you have implemented DTA-recommneded stats and not changed their name, this script will remove those too. 
Submitted By:   w