C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Interview   Jobs   Projects   Offshore Development    
Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing | Talk to Us |



My Profile

Gifts

Active Members
TodayLast 7 Days more...







Find tables used in a stored procedure


Posted Date: 03 May 2007    Resource Type: Code Snippets    Category: SQL

Posted By: Balamurali Balaji       Member Level: Diamond
Rating:     Points: 10



The following sql statement returns the tables used in a stored procedure. This sample uses a procedure 'GetAuthors' and returns all the tables accessed from thsi stored procedure.



select name from sysobjects where id in (select sd.depid from sysobjects so, sysdepends sd
where so.name = 'getAuthors' and
sd.id = so.id )






Responses

Author: kalpana sharma    15 May 2007Member Level: Bronze   Points : 0
nmk


Author: brett    06 Aug 2007Member Level: Bronze   Points : 0
sysdepends can't be relied upon for accuracy, the only foolproof method would be to actually look at the routine and parse the table names.


Author: Yuvraj    22 Aug 2007Member Level: Bronze   Points : 0
It wrks for the SQL Server which i ve seen and find it good solution to fetch the table names and saves time.


Author: Kapil Dhawan    17 Jun 2008Member Level: Gold   Points : 2
Hello
Nice piece of code
Thanks for sharing your knowledge with us.
I hope to see more good code from your side
This code will help lots of guys
Thanks to you
Regards,
Kapil



Author: UltimateRengan    14 Jul 2008Member Level: Diamond   Points : 0
hi,
ya its nice


Author: ravi    23 Jul 2008Member Level: Gold   Points : 0
thnx yaar it worked


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: Generate GUID (Unique Identifier) in SQL Server
Previous Resource: Automate Reindexing In SQL Server 2000
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

email fax service

Contact Us    Privacy Policy    Terms Of Use