Wednesday, January 6, 2016

Retrieving Object Defination

Using below methods we can retrieve object defination of particular database.


Exec Sp_help text 'Object name'
OBJECT_DEFINITION ( object_id )

select so.name,definition from sys.sql_modules sm, sys.objects so where sm.object_id=so.object_id

INFORMATION_SCHEMA.ROUTINES:
Returns one row for each stored procedure and function that can be accessed by the current user in the current database. The columns that describe the return value apply only to functions. For stored procedures, these columns will be NULL.

No comments:

Post a Comment