Cannot DROP the index 'Table.StatisticsName' because it is not a statistics collection.

Normally, When we try to DELETE the statistics using the following statement, The Error occrred

DROP STATISTICS TableName.StatisticsName
GO


Msg 3739, Level 11, State 1, Line 1
Cannot DROP the index 'Table.StatisticsName' because it is not a statistics collection.


The reason is, The statistics name we going to DELETE should be a Statistics collection.

Ok

What is statistics collection ?
"Creating statistics on multiple column on a table"

How to create ?
CREATE STATISTICS StatisticsName ON TableName(Column1,Column2)

Now the statistics collection can be deleted.

No comments:

Post a Comment