logo
  You are not logged in Join Log In
Navigation
Log In
[join]

[lost]

 
User Info
 Post to programmabilities.post [at] blogger.com
blogroll

Programmabilities Blog

2008-07-03

 
Search Stored Procedures
This searches all the Stored Procedures in 1 SQL Server database for the said string. I tested it in Query Analyzer and it found all the Stored Procedures that had occurrences of my "lq_Campaign" in 1 database:
SELECT ROUTINE_NAME, ROUTINE_DEFINITION
FROM INFORMATION_SCHEMA.ROUTINES
WHERE ROUTINE_DEFINITION LIKE '%lq_Campaign%'
AND ROUTINE_TYPE='PROCEDURE'

Here is another way

Below query you can searcg any table, stored procedure or views what ever has that expression as a column or object name.

SELECT * FROM SYSOBJECTS WHERE ID IN (SELECT ID FROM SYSCOMMENTS WHERE TEXT LIKE ‘%PRODUC%’)

The query produced all the object names--where ever it finds expression like ‘PRODUC‘.

Labels:

Comments: Post a Comment

Links to this post:

Create a Link



<< Home
Bio
The power of a network increases at a rate in proportion to the square of the number of users on that network.Metcalfe's Law
Archives
200611
200705
200706
200707
200708
200709
200711
200712
200802
200803
200805
200807