Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2005 - remove all _dta* indexes

Status
Not open for further replies.

SQLWilts

Programmer
Feb 12, 2001
651
GB
I have just upgraded an instance to SQL 2005.
I have a script that runs through and does an index defrag if the index is fragmented over a certain level.
My script is gagging on the _dta indexes - these are created by the engine tuning wizard.
I cant do a straight drop as to drop an index you need a table reference, which of course these do not have. I know that I could also just script around them, but I would rather not as all these superfluous indexes are, well, untidy (a touch of the OCD maybe? :)).
Does anyone have a script or know of a way of cleaning these off of the server?
Thanks
 
Forget it - numpty here having a Monday - they are not indexes - they are stats!!
 
And for those not picking up on what type of stats they are ... they are DTA stats (Data Tuning Advisor) stats that are created when you execute the DTA app.

Thanks

J. Kusch
 
The DTA will only create the stats if you select them and and have the changes applied. If you save the results of the DTA you can then name them according to your own convention the same is true for DTA indexes.

Paul
---------------------------------------
Shoot Me! Shoot Me NOW!!!
- Daffy Duck
 
Hiya,

Paul, thanks for your comment - but yes, I knew about the DTA - I was just having a Monday and not puttin 1 and 1 together!!

I have written a script to remove them all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top