Finding References of table ,function in Sql Server by simple query

 Hello Friends,
Most of the time you need how many references for particular table, function or procedure.
In that case if you are not aware of command which I am showing below you will do lot of work.
But if you see below command
it helps you a lot in finding your references

SELECT *
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE ‘%tblStudent%’

Here in like you can put table Name, function name or store procedure name whatever you want.
And you will get surprise when the result came. It will give you all the references related to that particular name.

So enjoy SQL SERVER.
Enjoy tricks.

Thanks 
Rajat Jaiswal

Advertisements