Sign in
|
Join
Home
Blogs
Ask
Just Learned
Interview Questions
Puzzles
Tutorials
Quiz
Modules
Getting Started with Adobe After Effects - Part 6:
Motion Blur
Syndicated Blogs
Upload Image
Close it
Select File
Its All About SQL Server
Like
Invite Friends
Browse by Tags ·
View All
Sql Server 2008
39
SQL Server 2012
39
Sql Server 2005
37
SQL Server Basics
11
TSQL Tips n Tricks
11
Performance Tuning
11
Sql Server Management
10
SQL Server Log
9
SQL Server Errors
9
Scripts
8
Archive ·
View All
July 2012
12
August 2012
8
September 2012
6
June 2012
6
November 2011
5
October 2011
3
August 2011
3
November 2012
2
October 2012
2
January 2012
2
ConnectSQL
Home
·
Most Liked
·
Most Discussed
·
Fans (16)
·
Preferences
SQL Server Scripts: Get All Nested Stored Procedures List (Procedures with dependent Procedures)
Jul 23 2012 1:35PM
by
aasim abdullah
A stored procedure can be called from another stored procedure as nested stored procedure. Recently on production server, we were asked for all stored procedures in which other stored procedures are called as nested. Here is simple script.
SELECT
*
FROM
(
SELECT
NAME
AS
ProcedureName
,
SUBSTRING
((
SELECT
', '
+
OBJDEP
.
NAME
FROM
sysdepends
INNER
JOIN
sys
.
objects
OBJ
ON
sysdepends
.
ID
=
OBJ
.
OBJECT_ID
INNER
JOIN
sys
.
objects
OBJDEP
ON
sysdepends
.
DEPID
=
OBJDEP
.
OBJECT_ID
WHERE
obj
.
type
=
'P'
AND
Objdep
.
type
=
'P'
AND
sysdepends
.
id
=
procs
.
object_id
ORDER
BY
OBJ
.
name
FOR
XML
PATH
(
''
)
),
2
,
8000
)
AS
NestedProcedures
FROM
sys
.
procedures
procs
)
InnerTab
WHERE
NestedProcedures
IS
NOT
NULL
Previous:
SQL Server: Restrict Login from Valid Machine IPs Only (Using Logon Trigger)
Next:
SQL Server Log: I/O is frozen on database DatabaseName
Republished from
Connect SQL
[12 clicks]
. Read the original version
here
[1 clicks]
.
aasim abdullah
23 ·
7% ·
2372
1
Liked
0
Lifesaver
0
Refreshed
0
Learned
0
Incorrect
Like this
Post this to my facebook wall
Tweet this
This was a true life saver
Thanks, this helped me to refresh my memory
Very informative, I just learned something new
I disagree, this information is incorrect
Submit
Your Comment
Sign Up
or
Login
to post a comment.
"SQL Server Scripts: Get All Nested Stored Procedures List (Procedures with dependent Procedures)"
rated 5 out of 5 by 1 readers
SQL Server Scripts: Get All Nested Stored Procedures List (Procedures with dependent Procedures)
,
5.0
out of
5
based on
1
ratings
+aasim abdullah
Copyright © Rivera Informatic Private Ltd
Contact us
Privacy Policy
Terms of use
Report Abuse
Advertising
[ZULU1097]