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 |
ryanlcs
Yak Posting Veteran
62 Posts |
Posted - 2009-10-27 : 06:04:53
|
HiIs there a way to check if a table is used or call within a stored proc?Thanks. |
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
saralstalin
Starting Member
11 Posts |
Posted - 2009-10-27 : 07:38:05
|
1. Run sp_helptext and check the text of the SP. You may also need to check the texts of functions and sproc called within the SP2. Check the execution plan of the SP.Rather than manually reading through text you can also run the below query.SELECT OB.Name, CO.textFROM sysobjects OB JOIN syscomments CO ON OB.id=CO.idWHERE OB.Name = '<SPName>' AND CO.text like '%<Table Name>%'Saral S Stalin |
|
|
saralstalin
Starting Member
11 Posts |
Posted - 2009-10-27 : 08:12:10
|
You can also runSP_DEPENDS '<storedprocedurename>' to get all dependencies and table callsSaral S Stalin |
|
|
|
|
|