Other Recent Articles

Find Specific Text on Stored Procedure

By Eranda Ketawalage on Wednesday, May 22, 2013 0 comments




Do you remember we had so many requirements to check a text on stored procedures or a view?

Think that we are going to change a field name of a table or a data type of a field. Or we are going to replace or delete a data table in your database. Database might be so big and there may be hundreds of stored procedures.
We can't open every single stored procedures or a view and check whether they are using the data table we going to delete.

For that,
We can simply find the stored procedures which are using this particular data table or a field. That may help us to reduce the work load more than 80%.

You can use this following query for it.

SELECT     *
FROM       INFORMATION_SCHEMA.ROUTINES
WHERE      ROUTINE_DEFINITION LIKE '%TableName%'

Category: SQL

0 comments:

Post a Comment

Amazon

Share this