Skip to content
Advertisement

What is the keyboard method for filtering in SQL Management Studio?

I make very heavy use of filtering in SQL Server Management Studio when working with a large number of stored procedures – but find it a slow process as I have to right click, move my mouse to select ‘filter’, type in filter, and then click OK.

Is there hotkey to pull up the filter dialog when I have the node I want to filter selected?

Thank you!

Advertisement

Answer

You can navigate to Tools > Options > Keyboard page > Short cut list – and here you can set any key board short cut keys for executing a stored procedure. You can define a stored procedure to search for a stored procedure and use this shortcut.

Or you can use this query to search for stored procedures –

SELECT A.NAME FROM SYSOBJECTS A (NOLOCK) WHERE
A.TYPE = 'P' AND A.NAME LIKE '%<filter_text>%'

If necessary you can perhaps create a function / stored procedure and use that to search stored procedures easily –

ALTER Function FindSP(@StringToSearch varchar(100))
returns table
AS
return
(

SELECT A.NAME FROM SYSOBJECTS A (NOLOCK) WHERE
    A.TYPE = 'P' AND A.NAME LIKE '%' + @StringToSearch + '%'  
)

And you can simple filter your stored procedures by using a select query –

select * from FindSp('<your_search_term>')
User contributions licensed under: CC BY-SA
4 People found this is helpful
Advertisement