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
 SQL Server Administration (2005)
 Tables in USE

Author  Topic 

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2008-05-13 : 16:38:59
I have a requirement where in I need to list all the tables used in stored procedures.

Is there an easy way to achieve this?

------------------------
I think, therefore I am - Rene Descartes

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-05-13 : 16:44:39
You could check out dependencies in Books Online.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-05-13 : 16:55:00
Dependencies can be inaccurate. Check out sys.sql_dependencies in BOL for details.

Here's an example:

CREATE PROC Sproc1 AS SELECT * FROM Table1
GO
CREATE TABLE Table1 (Column1 int)
GO

Both objects will be created successfully, however the dependency of Table1 for Sproc1 will not exist since the table did not exist when the stored procedure was created.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Database maintenance routines:
http://weblogs.sqlteam.com/tarad/archive/2004/07/02/1705.aspx
Go to Top of Page
   

- Advertisement -