我要统计所有用户建立的,系统的储存过程,还有删除用户建立的,有没有sql语句可以实现
------解决方案--------------------
--系统存储过程
select name from sysobjects where xtype= 'P ' and category=2
--用户自定义存储过程
select name from sysobjects where xtype= 'P ' and category=0
--删除所有用户自定义存储过程
declare @sql varchar(8000)
set @sql= ' '
SELECT @[email protected]+ 'drop proc '+NAME+char(13) FROM SYSOBJECTS
WHERE xtype= 'P ' and category=0
exec(@sql)