Skip to content

Instantly share code, notes, and snippets.

@weeksdev
Created January 8, 2014 16:39
Show Gist options
  • Save weeksdev/8319804 to your computer and use it in GitHub Desktop.
Save weeksdev/8319804 to your computer and use it in GitHub Desktop.
MSSQL: Get Stored Procs and Stored Proc Code From DB
select OBJECT_SCHEMA_NAME ( a.object_id) + '.' + a.name
,OBJECT_SCHEMA_NAME ( a.object_id) as [schema]
,OBJECT_DEFINITION(a.object_id) as def
from
sys.all_objects a
where a.type_desc = 'SQL_STORED_PROCEDURE'
and a.name not like 'sp_%'
and a.name not like 'xp_%'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment