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 |
|
NguyenL71
Posting Yak Master
228 Posts |
Posted - 2010-10-18 : 18:14:04
|
| Hi,I need to find all the SPs, Views, Triggers, and UDF associate with a table. Does anyone knows where I can such scripts. I have about 30 tables need to query out. The reason I amdoing this is because I just change the datatype of CustNumber from nvarchar(50) to varchar(10)and need to change all the procs, ect.. relates to the tables.SQL 2008.Thank you in advance. |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2010-10-19 : 13:28:02
|
you can get object dependency of table by using sp_depends stored procedure. but keep in mind this wont return ones where table is used inside dynamic sql. however, If your attempt is to find column usage you need to use query like belowselect OBJECT_NAME(object_id) AS Module_Name,definition from sys.sql_modules where definition LIKE '%CustNumber%' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|