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.
Author |
Topic |
Sql_forum
Yak Posting Veteran
50 Posts |
Posted - 2012-04-10 : 07:29:12
|
Hi i have a table with name some 'XYZ'and it is used in many stored procs.Now pls tell me how to findout in which all procedured table 'XYZ' is used??? |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-04-10 : 07:31:24
|
[code]SELECT [name]FROM sys.objectsWHERE OBJECT_DEFINITION(OBJECT_ID) LIKE '%XYZ%' AND [type] = 'P'[/code] |
 |
|
Sql_forum
Yak Posting Veteran
50 Posts |
Posted - 2012-04-10 : 07:44:04
|
Thanks Sunita :) |
 |
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
|
sunitabeck
Master Smack Fu Yak Hacker
5155 Posts |
Posted - 2012-04-10 : 17:24:06
|
quote: Originally posted by visakh16 please keep in mind that this wont return the stored procedures where table is used inside a dynamic sql string. for finding them you might need to use sys.sql_moduleshttp://visakhm.blogspot.com/2012/03/advantages-of-using-syssqlmodules-view.html------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/
I am not able to see why this would be so, given that both the query I posted and sys.sql_modules use object_definition(object_id) to retrieve the stored procedure definition. |
 |
|
|
|
|