In the past I thought when right-clicking on a table in SSMS and click ‘View Dependencies’ it will list out all tables and stored procs that uses the table. But recently I noticed it miss some dependencies.
Sometimes it misses some stored procs that reference it using SELECT statements, sometimes it’s INSERT or UPDATE statements. There doesn’t seem to be a common pattern on what is dependent and what is not. Can any one shed some light on this? (And no, it’s not a permission issue. I have sysadmin rights.)
My final goal is to find a way to find all dependencies on a particular table/view/stored proc using the simplest way (ie. little or no scripting) but it must return ALL dependencies, not just some. Any help?
PS. I’m using SQL Server 2005 and SSMS 2005.
Thanks.
This is “known” problem with SQL server. And actually this SSMS feature is dangerous to use, particularly when you want to find out which objects do you have to change, if you have done some changes to a Table or View.
Also – do not use scripts to search in syscomments, as far as if object text is more that 8000 symbols it will be split into several parts, so that name of your table can be cut into
record1: …… table_that_yo
record2: u_search ……..
Previously my “recipe” was to script all object into text files to disk and perform “search in files” using any text editor – like in SSMS of notepad++ (Find in Files) function.
I have now created a script that allows searching in object definitions using built-in SQL functions: