10/28/2021

Query to find all the Stored Procedures (SP) which are related to one or more specific tables.

In some scenarios, we need to identify the dependency of particular tables for stored procedures.

The below query will help to find all the Stored Procedures (SP) which are related to one or more specific tables.

----Option 1

SELECT DISTINCT so.name

FROM syscomments sc

INNER JOIN sysobjects so ON sc.id=so.id

WHERE sc.TEXT LIKE '%TableName%'


----Option 2

SELECT DISTINCT o.name, o.xtype

FROM syscomments c

INNER JOIN sysobjects o ON c.id=o.id

WHERE c.TEXT LIKE '%TableName%'

2 comments:

  1. I highly recommend AWS training for anyone aiming to delve into cloud computing. The structured modules and interactive sessions made it easy to grasp even the most intricate concepts. Moreover, the certification helped validate my skills and gave me an edge in the competitive job market. Please visit our website:- aws training and certification

    ReplyDelete

Tableau interview questions and answers for experienced professionals

  Tableau Interview Questions and Answers for experienced professional 1. What is TABLEAU? Tableau  is the powerful and fastest visualizing ...