Tag Archives: object definition

Different options to check object definition

SP_HELPTEXT system stored procedure is mostly used to check the object definition like definition of a user-defined rule, default, unencrypted Transact-SQL stored procedure, function, trigger, computed column, CHECK constraint, view, or system object such as a system stored procedure.

OBJECT_DEFINITION – is BUILT IN function returns the source text of the specified object. It returns the definition of check constraint, default constraint, stored procedure, function, rule and views.

Option 1

EXEC sp_helptext 'Procedure Name'

Option 2

select object_definition(object_id('procedure name'))

Option 3

select    [definition]
from    sys.sql_modules
where    object_id = object_id('procedure name')