Monday, September 13, 2010

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

Hello Friends,
Most of the time you need how many refrences for particulare 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 refrences

SELECT *
FROM sys.procedures
WHERE OBJECT_DEFINITION(OBJECT_ID) LIKE ‘%tblStudent%’
Here in like you can put tableName, function name or store procedure name what ever you want.
And you will got supprise when the result came. It will give you all the refrences related to that particular name.

So enjoy SQL SERVER.
Enjoy tricks.

Thanks
Rajat Jaiswal
Toy Story 3 (Four-Disc Blu-ray/DVD Combo + Digital Copy)