Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 To List all objects.

Author  Topic 

vikky
Yak Posting Veteran

54 Posts

Posted - 2009-12-01 : 05:15:35
HI,

Please help me any one

input : spname
output : it should list all object(tables ,functions ,views,procedures ) used in the given sp.

Rules:
If Table : table name starts with tbl_
if Function : starts with udf_
if sp : starts with sp_
some times i will use the object in another database also at that time i have to list that object with databasename.databaseowner.objectname.

but above rules may or may not follow while creating the objects.
i need to list all object used in the sp.

any one help i will appreciate them.

Thanks,
vikky.

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-12-01 : 07:39:39
exec sp_depends 'spname'

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

vikky
Yak Posting Veteran

54 Posts

Posted - 2009-12-01 : 23:55:35
HI,

i know that function.
Its not give correct relsult to me if i used object from other database.
it displays objects used in current database only.

Thanks,
vikky.
Go to Top of Page
   

- Advertisement -