Tuesday, March 1, 2011

Get all the object definitions: SPROC, TRIGGER, VIEW & FUNCTION

SELECT SchemaName=schema_name(schema_id),
       ObjectName=object_Name(m.object_ID),
       ObjectDefinition=definition
FROM   sys.SQL_Modules m
  INNER JOIN sys.objects o
    ON m.object_id=o.object_id

ORDER BY SchemaName, ObjectName

0 comments:

Post a Comment