We all have one snippet that we use several times daily (excluding logins/passwords), well here is one i like when working in SQL:
USE <DATABASE_NAME> SELECT ROUTINE_NAME, ROUTINE_DEFINITION, LAST_ALTERED FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION LIKE '%KEYWORD%' AND ROUTINE_TYPE = 'PROCEDURE' ORDER BY ROUTINE_NAME
I call it my very own tiny Google. I am sure this has been posted before but I wanted to share it again. Not only you will get a much smaller set of stored procedures to look into but you also have a sense of when was it last modified (with this version).
Now, what do you paste more than 100 times a day?
To Find a table with a Keyword in its columns:
SELECT OBJECT_NAME(object_id) as TableName
FROM sys.columns
WHERE name like ‘%KEYWORD%’;