It's very useful part of MS SQL code :
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%user_name()%'
AND ROUTINE_TYPE='PROCEDURE'
select * from sysobjects o inner join syscomments c on o.id=c.id
where c.text like '%user_name()%'
Here you can see two simplest piece of Sql code that executes search trough all Store procedure in selected database for termin "user_name()" . It is very fast and useful .
Goodbye :) I am going to finish my Iftar hehe
0 comments:
Post a Comment