Thursday, November 15, 2012

SQL Query to search by text


In case if the WPSBankDB name is changed and the same has to be changed with SPs in the FrameworkDB. In order to find the SPs for which the WPSBankDB name needs to be changed use the below Query


select
a.name from sys.procedures a join syscomments b on a.object_id =b.id
where text like '%wps%'


(OR)

SELECT DISTINCT o.name ,o.xtype  FROM syscomments c INNER JOIN sysobjects o ON c.id=o.id

WHERE c.TEXT LIKE '%cmd%'
 

1 comment:

  1. select * from sys.procedures order by modify_date desc
    where OBJECT_DEFINITION(object_id) like '%Enter Text%'

    ReplyDelete