Andrei
  • Posts: 398
  • Joined: 7/1/2012
Go to settings,Autoreplacements and add new autoreplacement with
token "sis" and following Replacement text:

/*
This is an easy way to look through the sources of all objectes in the database
if you need to find particular string. This script can be used, for example,
to find references of some specific object by other objects. Depending on the
size of your database you might want to limit the search scope to particular
object type. Just commend unneeded object types in WHERE statement.
Enter search string between %% marks in @SearchPattern initialisation statement.
When you get the results you can copy object name from "FullName" column and
use SSMSBoost to quickly locate it in object explorer, of you can search further
in results using "Find in ResultsGrid" function.

This script is provided to you by SSMSBoost as is. Improvements and comments are welcome.
Redistribution with reference to SSMSBoost project website is welcome.
SSMSBoost team, 2013
*/
DECLARE @SearchPattern NVARCHAR(128)

SET @SearchPattern = '%#%'

SELECT SCHEMA_NAME(o.schema_id) as [schema]
,o.[name]
,o.[type]
,'['+SCHEMA_NAME(o.schema_id)+'].['+o.[name]+']' as FullName
,OBJECT_DEFINITION(object_id) AS [Source]
FROM sys.objects AS o
WHERE lower(OBJECT_DEFINITION(o.object_id)) LIKE lower(@SearchPattern)
AND o.[type] IN (
'C',--- = Check constraint
'D',--- = Default (constraint or stand-alone)
'P',--- = SQL stored procedure
'FN',--- = SQL scalar function
'R',--- = Rule
'RF',--- = Replication filter procedure
'TR',--- = SQL trigger (schema-scoped DML trigger, or DDL trigger at either the database or server scope)
'IF',--- = SQL inline table-valued function
'TF',--- = SQL table-valued function
'V') --- = View
Joseph Flesche
  • Posts: 7
  • Joined: 2/25/2015
I have something similar setup for myself.

Is there a way to run something like this without an auto replace? Preferably something using the standard SSMS keyboard shortcuts.
SSMSBoost
  • Posts: 287
  • Joined: 6/30/2012
SSMS has possibility to assign shortcuts for short text commands, but the functionality is rather limited.
You can use native SSMS snippets, but there is no way to "shortcut"...
  • You cannot post new topics in this forum.
  • You cannot reply to topics in this forum.
  • You cannot delete your posts in this forum.
  • You cannot edit your posts in this forum.
  • You cannot create polls in this forum.
  • You cannot vote in polls in this forum.