Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Easily find one stored procedure in SQL Server Management Studio from 1000 in treeview?

Tags:

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? :)

like image 679
proudgeekdad Avatar asked May 28 '09 16:05

proudgeekdad


People also ask

How do I find Stored Procedures in SQL?

You can find the stored procedure in the Object Explorer, under Programmability > Stored Procedures as shown in the following picture: Sometimes, you need to click the Refresh button to manually update the database objects in the Object Explorer.

How do I view a stored procedure in SQL Server Management Studio?

Using SQL Server Management StudioExpand Databases, expand the database in which the procedure belongs, and then expand Programmability. Expand Stored Procedures, right-click the procedure and then select Script Stored Procedure as, and then select one of the following: Create To, Alter To, or Drop and Create To.


2 Answers

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: usp_user_*

like image 72
Lloyd Avatar answered Nov 14 '22 02:11

Lloyd


Check out the redgate tools here, they have a free search tool that makes this kind of stuff a breeze:

http://www.red-gate.com/products/sql-development/sql-search/

like image 41
James Records Avatar answered Nov 14 '22 04:11

James Records