Best is to use **FREE** tool from Red-Gate [SQL Search - quickly find SQL in SSMS][1]. You can even profile it while it is running to get the sql code and use that. Also, refer to Aaron's post on : [Keeping sysdepends up to date in SQL Server 2008][2]. Phil Factor has a great writeup on finding object dependency at [Exploring your database schema with SQL][3] [1]: http://www.red-gate.com/products/sql-development/sql-search/ [2]: https://sqlblog.org/2008/09/09/keeping-sysdepends-up-to-date-in-sql-server-2008 [3]: https://www.simple-talk.com/sql/t-sql-programming/exploring-your-database-schema-with-sql/