Search text into Stored Procedures or User Defined Function SQL

Search text into Stored Procedures or User Defined Function SQL

Il seguente snippet mostra come ricercare un testo all’interno di Stored Procedure o Function presenti nel database.

Ad esempio, supponiamo di voler ricercare in quali Stored Procedure oppure in quali User Defined Funcion è utilizzata la tabella "Employees".

E’ sufficiente eseguire la seguente query: 

SELECT name AS NOME_OGGETTO, text AS DEFINIZIONE, type AS TIPO FROM sysobjects SO INNER JOIN syscomments SC ON SO.id = SC.id WHERE text LIKE '%Employees%' ORDER BY name

Leave a Reply

Your email address will not be published. Required fields are marked *

Are you human? Time limit is exhausted. Please reload CAPTCHA.

This site uses Akismet to reduce spam. Learn how your comment data is processed.