views:

1437

answers:

3

Our database is about to reach 1000 stored procedures. Although we were wise and created a good scheme for naming the stored procedures, hunting for the stored procedure you need can be a bit frustrating as you scroll and scroll and scroll. If I know the exact name of the stored procedure I'm looking for, it would be great to identify it quickly and modify

For example, if I want to find p_Blah_Blah in the treeview and open it to modify it, is there a command to launch p_Blah_Blah in a new window for editing? Or perhaps a plugin that limits the view of stored procedures to what you are searching for? Anyone who wants to write a plugin? :)

+8  A: 

You can filter the tree, right click on "Stored Procedures" choose "Filter" and "Filter Settings".

As a general rule here we use naming conventions to do with context, for example all user sprocs are named: sp_user_*

Lloyd
They're not likely to rename 1000 procedures, especially with a satisfactory existing convention. But +1 for the Filter advice.
Joel Coehoorn
+1 for Filter - however, in SQL Server, all system SPs are prefixed with sp_. When any SP is called which begins sp_ the system tries to find it in the master database first before searching the current database. You are creating a performance hit with your naming convention.
Gary.Ray
This does the trick and works with our current naming conventions. Thanks! :)
proudgeekdad
it depends on your version of SQL how you do this.
Devtron
I actually meant usp_ but mistyped it seems, the point was putting context in the stored proc name.
Lloyd
our naming conventions work a bit like this...gp_ = generated proceduremp_ = maintenance procedurerp_ = report procedurep_ = plain old procedureFiltering out the gp_ makes things a bit easy to navigate.
proudgeekdad
+1  A: 

In Management Studio 2005 you can right click on the stored procedures folder (and other folders too) to set a filter, then you can type in all, or part, of the names that you are looking for.

If you just want to know details of parameters (or rows for a table etc.) then in a query window you can type the objects name, highlight it, and press alt-F1 to call sp_Help on the object.

Martynnw
+1  A: 

EXEC sp_HelpText 'your procedure name'

then proceed to modifying it.

Otávio Décio
This is a great feature, but not 100% what I was looking for. I will keep this one in the "bag-o-tricks" though. Thanks!
proudgeekdad
I was actually looking for exactly how to list the stored proc and ended up at this question..so upvote even though it's not specifically for the original question.
Jedidja