title: How to find a text inside stored procedures across multiple databases
body: <p>I have 40 + databases, and I want to find procedures in all databases that use the text <code>sp_reset_data</code>. <a href="https://stackoverflow.com/questions/674623/how-to-find-a-text-inside-sql-server-procedures-triggers">This query helped me a lot</a>:</p>
  
  <pre><code>DECLARE @Search varchar(255)
  SET @Search='sp_reset_data'
  
  SELECT DISTINCT
      o.name AS Object_Name,o.type_desc
      FROM sys.sql_modules        m 
          INNER JOIN sys.objects  o ON m.object_id=o.object_id
      WHERE m.definition Like '%'+@Search+'%'
      ORDER BY 2,1
  </code></pre>
  
  <p>But, this get the procedures only for the current database. Is there a way to improve this kind of query to look in every server's DB without manually changing the current DB?</p>