IF OBJECT_ID ('dbo.SQLObjectDefinitions','V') IS NOT NULL DROP VIEW dbo.SQLObjectDefinitions
GO 
CREATE VIEW dbo.SQLObjectDefinitions
AS    
SELECT 
    o.name AS ObjectName,
    o.type_desc AS ObjectType,
    m.definition AS ObjectDefinition
FROM 
    sys.sql_modules m
INNER JOIN 
    sys.objects o ON m.object_id = o.object_id
WHERE 
    o.type IN ('V', 'P', 'FN', 'IF', 'TF')  -- V: View, P: Procedure, FN: Scalar Function, IF: Inline Table Function, TF: Table Function