但是这个函数的是不向外输入的,不合适我们在程序中使用他,于是自已想办法,修改了一下,让他可以返回数据库对象的DDL
create procedure cxy_helptext
@objname nvarchar(776),
@sptext nvarchar(1000) output
as
set nocount on
declare @SyscomText nvarchar(4000) ,
@objid nvarchar(128)
select @objid=object_id(@objname)
select @sptext=[text] from syscomments where id=@objid
return -- sp_helptext
GO
declare @text nvarchar(1000)
EXECUTE cxy_helptext cxy_helptext, @text OUTPUT
print @text
@objname nvarchar(776),
@sptext nvarchar(1000) output
as
set nocount on
declare @SyscomText nvarchar(4000) ,
@objid nvarchar(128)
select @objid=object_id(@objname)
select @sptext=[text] from syscomments where id=@objid
return -- sp_helptext
GO
declare @text nvarchar(1000)
EXECUTE cxy_helptext cxy_helptext, @text OUTPUT
print @text