Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting it all from Statistics
Message
 
 
To
14/03/2008 17:27:29
General information
Forum:
Microsoft SQL Server
Category:
Other
Miscellaneous
Thread ID:
01302337
Message ID:
01302631
Views:
16
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--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform