Hello,
Thanks for the input you've provided.
However, I think you'd get better results using this function: object_definition(object_id)
Example:
SELECT TOP 1 object_id, object_definition(object_id) as Definition
FROM sys.all_objects
WHERE NOT(object_definition(object_id) IS...