h1

Iterating stored procedures in SQL

November 30, 2011

You can iterate the procedures and functions in your database with a query like this:

SELECT * 
FROM  INFORMATION_SCHEMA.ROUTINES

Or, if you only want to see the stored procedures and functions that you have created yourself:

SELECT specific_name, routine_type, created, last_altered 
FROM INFORMATION_SCHEMA.ROUTINES
where
substring(specific_name, 1,3) != 'sp_'
and substring(specific_name, 1,4) != 'sys_'
and substring(specific_name, 1,7) != 'aspnet_'

Advertisement

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 )

Connecting to %s

Follow

Get every new post delivered to your Inbox.