Solved

cannot drop statistics in sql server

Posted on 2010-08-21
4
2,458 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

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

My previous article  (http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Server/Windows_Server_2008/A_4466-A-beginners-guide-to-installing-SCCM2007-on-Windows-2008-R2-Server.html)detailed one possible method to get SCCM 2007 installed an…
On a regular basis I get questions about slow RDP performance, RDP connection problems, strange errors and even BSOD, remote computers freezing or restarting after initiation of a remote session. In a lot of this cases the quick solutions made b…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

837 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