Finding objects with a certain name

Jamie has talked about finding objects reference in SPs and a bit of SQL for this I find that I put these in an procedure prefixed sp and put in master I can then use the shortcut features in Query analyser and SQL Server management studio to execute the sp against some highlighted text.

Assign it to say CTRL +5  and then when ever you can't remember the exact name select some text of the bit you know hit CTRL +5 and you get a list of all the objects that contain that text in the name.

@Objectname varchar(100)
SELECT type, name
FROM sysobjects
WHERE name like '%' + @ObjectName + '%'
ORDER BY type, name
Published 19 August 2005 13:05 by simonsabin


No Comments