The meta data is from an SQL 2012 Server.
I have posted alot more, find the whole list here.
Goto Definition or MetaData
Definition:
sys.sp_statistics_rowset2(nvarchar @table_schema)MetaData:
create procedure sys.sp_statistics_rowset2 ( @table_schema sysname = null ) as -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - -- copy & pasted from version 1 of the SProc and removed checks for 1st parameter ! -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - select TABLE_CATALOG = db_name(), TABLE_SCHEMA = schema_name(o.schema_id), TABLE_NAME = o.name, CARDINALITY = convert (int, (-- Multiple partitions could correspond to one index. select sum(rows) from sys.partitions s_p where x.object_id = s_p.object_id and x.index_id = s_p.index_id ) ) from sys.all_objects o, sys.indexes x where (@table_schema is null or schema_id(@table_schema) = o.schema_id) and o.type in ('U') and x.object_id = o.object_id and x.index_id in (0,1) -- If there are no indexes then table stats are in a row with indid =0 order by 2, 3
No comments:
Post a Comment