trick question
From: Nitin Rana (Nitin_Rana_at_ibi.com)
Date: 07/22/04
- Next message: David Portas: "Re: Help with trigger cursor"
- Previous message: David Portas: "Re: Help with trigger cursor"
- In reply to: Kenny: "trick question"
- Next in thread: Kenny: "Re: trick question"
- Reply: Kenny: "Re: trick question"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 22 Jul 2004 14:30:44 -0700
This is not at all a tricky question.
All you need to do is loop through ID in sysobjects table
where type = 'P' and pass that ID to this code. If that
proc has any input parameters then it will display Proc
name, parameter name and other things. Run it and you
should be good to go.
Enjoy
-Nitin
@ProcId refers to the ID of a stored procedure in my user
DB, You need to loop through it.
declare @procId int
Select @procId = 161904144
if exists (select id from syscolumns where id =
@ProcId)
begin
-- INFO ON PROC PARAMS
print ' '
select
'Proc Name' = Object_Name(@ProcId),
'Parameter_name' = name,
'Type' = type_name(xusertype),
'Length' = length,
'Prec' = case when type_name(xtype)
= 'uniqueidentifier' then xprec
else OdbcPrec(xtype, length, xprec) end,
'Scale' = OdbcScale(xtype,xscale),
'Param_order' = colid,
'Collation' = collation
from syscolumns where id = @ProcID
END
>-----Original Message-----
>how to find out if any of procedures contain optional
parameter?
> logic is , if there is a "=" sign before first "AS",
then I think there
>will be at least one optional parameter.
>
>WELL, this query will not solved my problem. is there a
way?
>
>
>
>SELECT ROUTINE_NAME
>
> FROM INFORMATION_SCHEMA.ROUTINES
>
> WHERE UPPER(ROUTINE_DEFINITION) LIKE '%=%AS%'
>
>
>
>.
>
- Next message: David Portas: "Re: Help with trigger cursor"
- Previous message: David Portas: "Re: Help with trigger cursor"
- In reply to: Kenny: "trick question"
- Next in thread: Kenny: "Re: trick question"
- Reply: Kenny: "Re: trick question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|