I just came across the system view sys.sql_modules
today. What is a module versus a DB object? The view returns, most prominently, a column containing the def
It's the blocks of T-SQL statements that make up a stored procedure, a stored function, a trigger or a view definition.
From "Books Online" in the "CREATE PROCEDURE" section:
Getting Information About Stored Procedures To display the definition of a Transact-SQL stored procedure, use the sys.sql_modules catalog view in the database in which the procedure exists.
In sys.sql_modules, you'll find the actual T-SQL code.
Marc