Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Getting it all from Statistics
Message
 
 
À
14/03/2008 17:27:29
Information générale
Forum:
Microsoft SQL Server
Catégorie:
Autre
Divers
Thread ID:
01302337
Message ID:
01302631
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>I have 120 tables which have been migrated into SQL Server. It is so smart that within its Statistics option, it tells me about additional optimization I could benefit from. So, in there, I have seen so far 3 tables where at least one field could be indexed. This represents fields that we forgot to index in VFP. So, in order to see it, I have to open the Statistics section for each table. Is there a way to obtain that within one command?

You can query the sys.stats and sys.stats_columns catalog views.
SELECT object_name(s.object_id) AS TableName, COL_NAME(s.object_id, sc.column_id) AS ColumnName,
		* 
	FROM sys.stats s
		JOIN sys.stats_columns sc ON s.object_id = sc.object_id AND s.stats_id = sc.stats_id
	WHERE object_name(s.object_id) NOT LIKE 'sys%' 
	ORDER BY 1,2
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform