Home > SQL Challenge > Find which procedures contain text string

Find which procedures contain text string

Very often, we know the table name, but do not know which procedure populates the table (assuming that it’s a stored procedure that does that, not a SSIS package).

Use this simple query against the INFORMATION_SCHMEA.ROUTINES:

select    specific_catalog
,        specific_schema
,        routine_name
,        routine_type
,        routine_definition
,        created
,        last_altered
from    INFORMATION_SCHEMA.ROUTINES
where    routine_definition like ‘%myTableNameString%’

Categories: SQL Challenge
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: