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