>I need a little help. I am trying to drop some statistics in SQL Server 2000 but I do not know how to check to see if it exists first to keep it from bombing. I tried sysobjects and sysindexes to no avail. I know that in SQL Server 2005 I can reference sys.stats, but this does not work in 2000. Any and all help will be greatly appreciated. Below is a sample of my SQL 2005 Code so you can see what I am trying to accomplish in SQL 2000.
>
>IF EXISTS(
> SELECT * FROM sys.stats
> WHERE object_id = object_id('OrderFL')
> AND name = '_dta_stat_514100872_4_7')
> DROP STATISTICS OrderFL._dta_stat_514100872_4_7
>
>GO
Check sp_HelpStats in BOL.
See also
Re: Getting it all from Statistics Thread #
1302337 Message #
1302628 (and the whole thread).
If it's not broken, fix it until it is.
My Blog