sql在所有存储过程中查询包含某字符串的执行语句
直接在查询分析器中执行以下代码就行:
方法一
select name
from sysobjects o, syscomments s
where o.id = s.id
and text like '%test%'
and o.xtype = 'P'
方法二
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%test%'
AND ROUTINE_TYPE='PROCEDURE'
返回所有出现过该字符串的存储过程名:
name1proc_PaperCopyTo2proc_PaperSaveAs3proc_SaveAsTemp
共有 0 条评论