Finding References to A SQL Object within Views and Procedures

We recently had a customer who wanted to find out if there were any references to another SQL database within the SQL views and procedures that had been developed within their Infor CRM database. There is a way to do this by using the sql_modules. Objects of type Store Procedures, Replication Filter, View, Trigger, Scalar Function , Inline table Function, Table Value Function, Rule, and Default all have an associated SQL module.

select object_name(a.object_id), a.*
from sys.sql_modules a
where a.definition like N'%someDBName%'

Kris Halsrud

Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

Submit a Comment

Your email address will not be published.

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!