以sp_help为例子:获得了sp_help的源代码.可以自己分析改造 sp_helptext sp_help /* Sccsid = "%Z% generic/sproc/%M% %I% %G%" */ /* 4.8 1.1 06/14/90 sproc/src/help */ /* ** Messages for "sp_help" 17570 ** ** 17460, "Object must be in the current database." ** 17461, "Object does not exist in this database." ** 17570, "Operating System File" ** 17571, "---------------------" ** 17573, "Object is Remote/External" ** 17574, "-------------------------" ** 17575, "Object existed prior to Omni" ** 17576, "Lock scheme is Allpages" ** 17577, "Lock scheme is Datapages" ** 17578, "Lock scheme is Datarows" ** 17579, "Lock scheme Unknown or Corrupted" ** 17581, "Trigger is disabled." ** 17582, "Trigger is enabled." ** 18571, "The attribute '%1!' is not applicable to tables with allpages lock scheme." */ /* ** IMPORTANT NOTE: ** This stored procedure uses the built-in function object_id() in the ** where clause of a select query. If you intend to change this query ** or use the object_id() or db_id() builtin in this procedure, please read the ** READ.ME file in the $DBMS/generic/sproc directory to ensure that the rules ** pertaining to object-id's and db-id's outlined there, are followed. */ create procedure sp_help @objname varchar(92) = NULL /* object name we're after */ as declare @typeid int /* type of object in systyp es */ declare @sysstat smallint /* the type of the object */ declare @OS_file varchar(255) /* physical file for ext tab */ declare @msg varchar(250) declare @sptlang int declare @len1 int, @len2 int, @len3 int, @len4 int, @sysstat2 int declare @sqltex t varchar(255) /* SQL to execute using execute ** immediate. */ if @@trancount = 0 begin set chained off end set transaction isolation level 1 select @sptlang = @@langid if @@langid != 0 begin if not exists ( select * from master.dbo.sysmessages where error between 17100 and 17109 and langid = @@langid) select @sptlang = 0 end set nocount on 略. |