December 14, 2007 at 7:15 am
Hi all
How to get the parameter name of the stored procedure in the table.
Thanks
Warm Regards,
Shakti Singh Dulawat
Before printing, think about the environment
Do the impossible, and go home early.
December 14, 2007 at 8:03 am
Not sure what you mean about the stored procedure in the table.
You don't need the name of the stored procedure to call it, you can send in parameters in order. I thought there was an ADO method that would return them.
December 14, 2007 at 10:10 am
ALTER PROCEDURE [dbo].[Award_Category_Insert]
-- VARIABLE DECALARTION--
@Award_Category_Name as nvarchar(100)
AS
BEGIN
SET NOCOUNT ON
-- AWARD CATEGORY WILL BE INSERT--
Insert into Award_Category_Master(Award_Category_Name, Is_Deleted ) Values (@Award_Category_Name,0)
END
Suppose we have about SP name is Award_Category_Insert and it has 1 parameter i.e. @Award_Category_Name
I Just want to pass the SP name in another SP and it will provide me the list of all it's parameter.
Thanks
Warm Regards,
Shakti Singh Dulawat
Before printing, think about the environment
Do the impossible, and go home early.
December 14, 2007 at 6:30 pm
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE Specific_Name = 'Award_Category_Insert'
--Jeff Moden
Change is inevitable... Change for the better is not.
December 14, 2007 at 9:32 pm
Thanks , I got another way so I am posting it here.
I got the solution
sp_help or sp_helptext
the first one will give the signature of the stored proc, the second will give you the actual stored proc itself.
usage:
sp_help Award_Category_Insert
sp_helptext Award_Category_Insert
Warm Regards,
Shakti Singh Dulawat
Before printing, think about the environment
Do the impossible, and go home early.
December 17, 2007 at 3:08 am
and you also get it from the syscomments table.
select text
from syscomments
where id = object_id('procedurename')
karthik
December 18, 2007 at 12:57 pm
This will retrieve a bit more info about SP parameters
select 'SP name' = o.name, ParamName= c.name, DataType = t.name,
c.Length, Direction = case c.isoutparam
when 0 then 'adParamInput'
when 1 then 'adParamInputOutput'
End ,
c.colorder
from syscolumns c, sysobjects o, systypes t
where c.[id] = o.id and t.xusertype = c.xusertype and o.type = 'P' and o.status >= 0
order by o.name, colorder
December 1, 2010 at 2:42 am
Thanks JEFF..Its very Informative..thanks a lot about "retrieving all the parameter names from the procedure
December 1, 2010 at 2:44 am
Jeff Moden (12/14/2007)
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE Specific_Name = 'Award_Category_Insert'
Excellent...thanks alot
December 4, 2010 at 9:58 am
bhuvan.ram (12/1/2010)
Jeff Moden (12/14/2007)
SELECT * FROM INFORMATION_SCHEMA.PARAMETERS WHERE Specific_Name = 'Award_Category_Insert'
Excellent...thanks alot
Thanks for the feedback. 🙂
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 10 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic. Login to reply