Solved

cannot drop statistics in sql server

Posted on 2010-08-21
4
2,497 Views
Last Modified: 2013-11-21
I have a problem deleting one of the statistics in the table.
when i script
if  exists (select * from sys.stats where name = N'inx_add_1' and object_id = object_id(N'[dbo].[Call_Details_]'))
DROP STATISTICS [dbo].[Call_Details_].[inx_add_1]

then get an error below
Msg 3739, Level 11, State 1, Line 3
Cannot DROP the index 'dbo.Call_Details_.inx_add_1' because it is not a statistics collection.


any idea why is this happening, and when i  right click on the stats name the "script statistics as"  is grayed out by default. any idea friends....
0
Comment
Question by:espanolanthony
  • 3
4 Comments
 
LVL 8

Accepted Solution

by:
Yiogi earned 500 total points
ID: 33491601
It appears that it's an index and not statistics
try drop index instead
0
 
LVL 1

Author Comment

by:espanolanthony
ID: 33491617
But there is no index bu that name
0
 
LVL 1

Author Comment

by:espanolanthony
ID: 33491626
yes i got it. thanks i removed all the indexes expect PK then deleted stats and then recreated all the indexes again.

thanks for the highlight
0
 
LVL 1

Author Closing Comment

by:espanolanthony
ID: 33491629
thanks
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Some time ago I faced the need to use a uniform folder structure that spanned across numerous sites of an enterprise to be used as a common repository for the Software packages of the Configuration Manager 2007 infrastructure. Because the procedu…
Welcome to my series of short tips on migrations. Whilst based on Microsoft migrations the same principles can be applied to any type of migration. My first tip is around source server preparation. No migration is an easy migration, there is a…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question