Ask Paula!

...bringing you notes from the field...

  Home  |   Contact  |   Syndication    |   Login
  147 Posts | 5 Stories | 133 Comments | 0 Trackbacks

News

Copyright © 2008-2018 Paula DiTallo

Tag Cloud


Archives

Post Categories

.NET Development

Enterprise Integration

Entertainment - Games

Java Development

Mobile/PDA Development

Professional Affiliations


This will locate specific text within an object on a given database. In this case, it will find all views, stored procs which have the text string "Department" somewhere in the body.

use [databaseInstance]
go

SELECT DISTINCT 
   o.name AS Object_Name,
   o.type_desc
FROM sys.sql_modules m        
  INNER JOIN    sys.objects o 
     ON m.object_id = o.object_id 
WHERE m.definition Like '%Department%';
posted on Tuesday, December 1, 2015 12:24 PM