Do you know of a way to get a list of the statistics used against this table.field? There are about 10 that I need to drop before the ALTER statement will work.
I have tried using:
select * from sysindexes WHERE ID = OBJECT_ID(N'[dbo].[mytable]')
which returns all indexes and statistics on the table, but the only way I can see to filter down to statistics is when SUBSTRING(name, 1, 4) = 'hind'
The statistics all start with hind_##... Not really the 100% code I am looking for.
>I can think of no reason that you app would fail if you deleted the statistics. There could be a performance impact since the statistics were created by the optimizer when it felt that they were needed.
>
>I'm thinking that the optimizer will recreate the statistics although I haven't had an opportunity to test this.
>
>Check to see what sp_helpindex returns when given a statistic. If it gives you the columns involved, you could script a command to recreate the statistics.
>
>-Mike