SQL Server查看系统存储过程及视图的定义

对stored procedure:

SELECT OBJECT_DEFINITION(OBJECT_ID('sp_replmonitorsubscriptionpendingcmds'));


EXEC sp_helptext 'sp_replmonitorsubscriptionpendingcmds';

对View:

SELECT OBJECT_DEFINITION(OBJECT_ID('MSdistribution_status'));


EXEC sp_helptext 'MSdistribution_status';