Searching for specific text in a VIEW

  • Ok. I have searched syscomments many times to search for text in a stored procedure; but now I have a need to search for specific text in a view. Has anyone done this before? Thanks much!

  • --for a single object

    Select * from dbo.SysComments where id = object_id('ViewName') and text like '%whatever%'

    --for any number of views (and what I suppose you are asking)

    Select Distinct O.Name from dbo.SysObjects O inner join dbo.SysComments C on O.id = C.id and O.XType = 'V' where text like '%Whatever%' order by O.Name

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply