Finding a particular text in the whole database !!

Posted by Puneet20884 under Sql Server category on | Views : 2574
Simple block of SQL that will let you find a particular text needed sometimes like when you want to observe which procs are deleting data or which are setting particular column to some particular value so this is quite handy in that case :

Ist a simple SQL block and goes as

SELECT Distinct sysobjects.Name
FROM sysobjects JOIN syscomments
on sysobjects.Id = syscomments.ID AND sysobjects.Type = 'P'
AND Text LIKE '% delete %'
ORDER BY sysobjects.Name

you can modify it a bit as per your requirements.

Comments or Responses

Posted by: SheoNarayan on: 1/16/2010 Level:HonoraryPlatinum | Status: [Administrator]
Dear Puneet,

Thank you very much for this code snippet, really worth.

Posted by: Puneet20884 on: 1/17/2010 Level:Bronze | Status: [Member]
My Pleassure sir, you liked it !! Thank you so much !!

Login to post response