SQL server queries where to call the stored procedure or table

Time:2020-11-28

When we first started to contact some formed projects, it’s ok if it is not complex. If it is complex, for example, ERP project, in which the business logic is complex, it may be called back and forth between various stored procedures. We can use the

SQL server queries where to call the stored procedure or tableSQL server queries where to call the stored procedure or table

--Query where to call the table or stored procedure
select distinct object_name(id) from syscomments where id in
(select id from sysobjects where type: 'p') and text like '% table name or stored procedure name%'

View Code

This statement can query where the table or stored procedure has been called, find problems more quickly, and be familiar with the project