Stored procedures for a table??? | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Stored procedures for a table???

Hi,<br /><br />1.I have a table in one of the data bases of sql server 2005.<br /> I want to know how many stored procedures are involved in using this table.<br /><br />Is there any way we can do it.<br /><br />2. Also i have a primary key for this table for example "empid"<br /> How do i know how many and what tables are using this pk as their fk’s<br /><br />thanks[<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br />
Answer to your second question is sp_fkeys TableName i am not sure about the first one… Madhu
sp_depends <tablename> for first one. ***********************
Dinakar Nethi
SQL Server MVP
***********************
Thank you, it helped me<br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />
sp_depends is not always dependable <img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br /><br /><br /><br />MohammedU.<br />Moderator<br />SQL-Server-Performance.com
I agree with Mohammed, search for string from syscomments table instead. Thanks, Name
———
Dilli Grg (1 row(s) affected)
If you know what I mean.[<img src=’/community/emoticons/emotion-5.gif’ alt=’;)‘ />]<br /><br /><pre id="code"><font face="courier" size="2" id="code"><br />SELECT DISTINCT Object_Name(ID) As [Dependent Object Names]<br />FROM syscomments <br />WHERE text like ‘%TableName%'<br /></font id="code"></pre id="code"><br /><br /><pre id="code"><font face="courier" size="2" id="code"><br />Thanks,<br /><br />Name<br />——— <br />Dilli Grg <br /><br />(1 row(s) affected)<br /></font id="code"></pre id="code">
Thank you,<br />You are right, after changing to the above query it showed me 2 more stored proc’s<br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />
<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote"><i>Originally posted by i.netdeveloper</i><br /><br />Thank you,<br />You are right, after changing to the above query it showed me 2 more stored proc’s<br /><br /><img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ /><br /><hr height="1" noshade id="quote"></font id="quote"></blockquote id="quote"><br /><br />[<img src=’/community/emoticons/emotion-1.gif’ alt=’:)‘ />]<br /><br /><pre id="code"><font face="courier" size="2" id="code"><br />Thanks,<br /><br />Name<br />——— <br />Dilli Grg <br /><br />(1 row(s) affected)<br /></font id="code"></pre id="code">
]]>