Find all occurrences of sp_send_dbmail in a sql server 2008R2 database
<p>I have a database with 100s of stored procedures, triggers and jobs. some of these use <code>sp_send_dbmail</code> to send out an email from within SQL SERVER, but I would like to get a list of all <code>stored procedures/triggers/jobs</code> that send out an email. I tried to look online for something like this, but could not find any.</p>

<p><a href="https://stackoverflow.com/questions/9185871/how-to-search-sql-server-database-for-string">How to search sql server database for string?</a></p>

<p>From the above link, I have tried a few scripts that finds all occurrences of the string(sp_send_dbmail), but that does not help me, because most of those search for data within the tables and columns, not the actual stored procedure script.</p>

<p>Can someone point me in the right direction.</p>