MSSQL sql to get Stored procedure source

Forum related to version 6.5.1 (alpha) and 6.6.x (beta) of ZeosLib's DBOs

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
sandeep_c24
Expert Boarder
Expert Boarder
Posts: 158
Joined: 06.11.2005, 01:43

MSSQL sql to get Stored procedure source

Post by sandeep_c24 »

Is it ok to use the following sql to get the Stored procedure metadata for MSSQL?

Code: Select all

select
      convert(sysname,db_name()) as PROCEDURE_QUALIFIER,
      convert(sysname,user_name(o.uid)) as PROCEDURE_OWNER,
      convert(nvarchar(134),o.name +';'+ ltrim(str(c.number,5))) as PROCEDURE_NAME,
      -1 as NUM_INPUT_PARAMS,
      -1 as NUM_OUTPUT_PARAMS,
      -1 as NUM_RESULT_SETS,
      convert(varchar(254),null) as REMARKS,
      2 as PROCEDURE_TYPE,
      convert(text, c.text)
from dbo.syscomments c, dbo.sysobjects o
where o.id = c.id
and c.colid = 1
and o.type in ('P', 'FN', 'TF', 'IF')		/* Object type of Procedure, scalar UDF, table UDF */
and permissions (o.id)&32 <> 0
order by 1, 2, 3
I have used the code from sp_stored_procedures which is used to get stored procedure info in Zeos.

Regards

Sandeep
Post Reply