TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Find Out Table and Function Used in Procedure
Dharmesh Singh
Jul 27
2016
Code
694
0
3
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
WITH
cte
AS
(
SELECT
source.
name
AS
source,
target.
name
AS
target,
CASE
target.xtype
WHEN
'U'
THEN
'Table'
WHEN
'P'
THEN
'Store Procedure'
WHEN
'FN'
THEN
'Function'
WHEN
'V'
THEN
'View'
END
AS
type
FROM
sysdepends d
INNER
JOIN
sysobjects source
ON
source.id = d.id
INNER
JOIN
sysobjects target
ON
target.id = d.depid
WHERE
source.xtype =
'P'
and
source.
name
=
'PAYSP_EMPLOYEEUSERLOGINCHECK'
)
SELECT
DISTINCT
target, source, type
FROM
cte
ORDER
BY
target, type
DESC
, source
Stored Procedure
sql function