本语句适用于MS SQL SERVER 2000/2005
SET
QUOTED_IDENTIFIER
ON
GO
SET
ANSI_NULLS
ON
GO

--
GetContentByProcedureName'[dbo].[存储过程名]'
Create
procedure
GetContentByProcedureName
(
@ProcedureName
nvarchar
(
500
))
as

if
exists
(
select
*
from
dbo.syscomments
where
id
=
object_id
(N
''
+
@ProcedureName
+
''
))
select
c.
text
,c.encrypted,c.
number
,xtype
=
convert
(
nchar
(
2
),o.xtype),
datalength
(c.
text
),
convert
(
varbinary
(
8000
),c.
text
),
0
from
dbo.syscommentsc,dbo.sysobjectso
where
o.id
=
c.id
and
c.id
=
object_id
(N
''
+
@ProcedureName
+
''
)
order
by
c.
number
,c.colid
option
(robust
plan
)
GO
SET
QUOTED_IDENTIFIER
OFF
GO
SET
ANSI_NULLS
ON
GO

本文介绍了一个用于MSSQL SERVER 2000/2005的存储过程,该过程能够通过指定的存储过程名称来获取其内容、加密状态、编号等详细信息。
1031

被折叠的 条评论
为什么被折叠?



