Many a times need arises to find objects a stored procedure depends on. The blogs describes a way to find dependencies of stored procedure in SQL server.

The below query creates a stored procedure.

The below query lists all the objects the procedure usp_getpersonaddress depends on.

The output of above query is shown below.

find dependencies of stored procedure in sql server

The procedure depends on tables Person.Address and Person.Person which is exactly what we intended to find. This comes handy when altering/dropping tables in a database.

 

Regards

Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook