Monday, January 12, 2009

SQL Server search stored procedures

Anyone who works with SQL Server has at one point or another faced the simple question: “how can I find all stored procedures that reference a given table?”, or “how can I find all the objects in the database the definition of which contains a certain word or phrase?”. While SQL Server makes those tasks relatively easy those are still time consuming and when done on an ad-hoc bases chances of missing or forgetting something are relatively high.

The good news is: you don’t have to struggle with this when there is a really cool and completely free tool called xSQL Object Search available. So how does xSQL Object Search work? Very simple:
  • You connect to the server you are interested on
  • Choose to search in a certain database or All Databases on that server
  • Define your search criteria
    • What are you looking for
    • How do you want to search (exact match, contains, starts with, ends with, sql server expression, regular expression)
    • Choose where do you want to look - the object name, object definition, or both?
    • Finally choose which object types you wish to search (all objects or just certain types of objects like stored procedures, views, tables, triggers etc.)
  • Click on Find Now (see the screen shot below


xSQL Object Search is a free tool and you can download it from: http://www.xsql.com/download/sql_server_object_search/
Applies to:
SQL Server search tables
SQL Server search views
SQL Server search stored procedures
SQL Server search triggers
SQL Server search functions

No comments: