Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Checking to see if a Statistic Exists
Message
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Stored procedures, Triggers, UDFs
Titre:
Checking to see if a Statistic Exists
Versions des environnements
SQL Server:
SQL Server 2000
Divers
Thread ID:
01326484
Message ID:
01326484
Vues:
215
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
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform