Monday, March 30, 2009

Query for syscomments and sysobjects

This query is to find name of Stored procedure/View/Trigger/etc. from database having Tables/views/stored procedures/etc.

SELECT so.name, so.xtype FROM syscomments sc

INNER JOIN sysobjects so ON sc.id = so.id
WHERE so.name = '%myView%'

No comments: