Pages

Friday, May 30, 2014

How to determine table reference /used in stored procedure- TIP #9

To determine table used in stored procedure or table reference

We need to run following command
Go
SELECT object_Name(Id)as objectName,text FROM syscomments  WHERE text like '%tblUser%'
Go





We can use following command as well
Go
SELECT ROUTINE_NAME,ROUTINE_DEFINITION FROM INFORMATION_SCHEMA.ROUTINES WHERE ROUTINE_DEFINITION like '%tblUser%'
 GO


In the above queries we have used tblUser as table name we can replace it and add any other table name which we want to find.
Enjoy!!!

No comments:

Post a Comment