"definition NOT LIKE '%User_SP_Check_Validity %'"I think User_SP_Check_Validity might not be followed by a space? Might be followed by ";" or linebreak - maybe other things too (can't immediately think of any others)Assuming it is never the very last thing in the Sproc code then this would probably work:definition NOT LIKE '%User_SP_Check_Validity[^A-Za-z0-9_]%'
and if it could eb the very last thing then definition + ' ' NOT LIKE '%User_SP_Check_Validity[^A-Za-z0-9_]%'
but that will probably effect performance - won't matter for a one-off report though."AND definition like '%CREATE PROCEDURE%'"I think probably better is:SELECT OBJECT_NAME(M.object_Id) AS [Name]FROM sys.sql_modules AS M JOIN sys.objects AS O ON O.object_id = M.object_id AND O.type = 'P'WHERE definition NOT LIKE '%User_SP_Check_Validity[^A-Za-z0-9_]%'