• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2858
  • Last Modified:

cannot drop statistics in sql server

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
espanolanthony
Asked:
espanolanthony
  • 3
1 Solution
 
YiogiCommented:
It appears that it's an index and not statistics
try drop index instead
0
 
espanolanthonyAuthor Commented:
But there is no index bu that name
0
 
espanolanthonyAuthor Commented:
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
 
espanolanthonyAuthor Commented:
thanks
0

Featured Post

Independent Software Vendors: 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!

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now