合 SQL Server数据库对象类型和个数统计
Tags: MSSQLSQL Server脚本对象类型和个数统计
SQL Server数据库对象查询(只查询当前数据库)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | select case when xtype='U' then '表' when xtype='P' then '存储过程' when xtype='FN' then '标量值函数' when xtype='IF' then '表值函数' when xtype='V' then '视图' when xtype='TR' then '触发器' when xtype='SN' then '同义词' end as xtype, count(*) cnt from sysobjects where xtype in('P','FN','IF','TR','TR','U','V') and uid=1 and category=0 group by xtype order by xtype; |