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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s