select case xtype when ' C ' then ' constraints ' when ' D ' then ' default value constraint ' when ' F ' then ' foreign KEY constraint ' when ' FN ' then ' Scalar functions ' when ' IF ' then ' inline table functions ' when ' K ' then ' primary KEY constraint ' when ' L ' then ' log ' when ' P ' then ' stored procedure ' when ' R ' then ' rules ' when ' RF ' then ' Replication filter stored procedure ' when ' S ' then ' system table ' when ' TF ' then ' table function ' when ' TR ' then ' Trigger ' when ' U ' then ' user table ' when ' V ' then ' view ' when ' X ' then ' extended stored procedure ' when ' AF ' then ' aggregate functions ' when ' FS ' then ' scalar functions ' when ' FT ' then ' Table valued function ' when ' IF ' then ' inline table functions ' when ' IT ' then ' internal table ' when ' PC ' then ' stored procedure ' when ' FS ' then ' scalar functions ' when ' PK ' then ' primary KEY constraint ' when ' SN ' then ' synonyms ' when ' SQ ' then ' service queue ' when ' TA ' then ' assembly (CLR) DML Trigger ' when ' TT ' then ' table type ' when ' UQ ' then ' unique constraint (type to k) ' end as type, count (1) as number from dbo.sysobjects group bycase xtype when ' C ' then ' constraints ' when ' D ' then ' default constraint ' when ' F ' then ' foreign KEY constraint ' when ' FN ' then ' scalar functions ' when ' IF ' then ' inline table functions ' when ' K ' then&nbsP; ' PRIMARY KEY constraint ' when ' L ' then ' log ' when ' P ' then ' stored procedure ' when ' R ' then ' rules ' when ' RF ' then ' replication filter stored procedures ' when ' S ' then ' system table ' when ' TF ' then ' table functions ' when ' TR ' then ' Trigger ' when ' U ' then ' user table ' when ' V ' then ' view ' when ' X ' then ' extended stored procedure ' when ' AF ' then ' aggregate function ' when ' FS ' then ' scalar function ' when ' FT ' then ' table valued function ' when ' IF ' then ' inline table function ' when ' IT ' then ' internal table ' when ' PC ' then ' stored procedure ' when ' FS ' then ' scalar functions ' when ' PK ' then ' primary KEY constraint ' when ' SN ' then 'Synonyms ' when ' SQ ' then ' service queue ' when ' TA ' then ' assembly (CLR) DML trigger ' when ' TT ' then ' table type ' when ' UQ ' then ' unique constraint (type for k) ' end
This article is from the "Sukun" blog, make sure to keep this source http://sukunwu.blog.51cto.com/10453116/1737671
Statistics Database objects