PC Review


Reply
Thread Tools Rate Thread

Determining parameters of a stored procedure

 
 
uiranejeb
Guest
Posts: n/a
 
      24th Jul 2003
How can I determine the parameters of a SQL Server stored procedure based
only the name of stored procedure.
Ideally it will be to obtain a collection of SqlParameters.

Thanks!


 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      24th Jul 2003
thsis query will return the info

select
'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 = object_id('dbo.myproc')
order by colid


-- bruce (sqlwork.com)


"uiranejeb" <(E-Mail Removed)> wrote in message
news:#(E-Mail Removed)...
> How can I determine the parameters of a SQL Server stored procedure based
> only the name of stored procedure.
> Ideally it will be to obtain a collection of SqlParameters.
>
> Thanks!
>
>



 
Reply With Quote
 
Peter Gossmann
Guest
Posts: n/a
 
      27th Jul 2003
Have a look at Microsofts Data Access Application Block. It contains a
SQL Helper class that is doing exactly what you need. It retrievs the
Parameters of a stored Procedure and caches them. Additionally
SQLHelper class provides methods to ease the execution of stored
procedures, so that you don't even have to care about the
specification of SQLParameters.

Data Access Application Block
http://msdn.microsoft.com/library/de...ml/daab-rm.asp

Hope this helps
Peter Gossmann
MCP for ASP.NET

"uiranejeb" <(E-Mail Removed)> wrote in message news:<#(E-Mail Removed)>...
> How can I determine the parameters of a SQL Server stored procedure based
> only the name of stored procedure.
> Ideally it will be to obtain a collection of SqlParameters.
>
> Thanks!

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Way too many Stored Procedure Parameters Sam Shrefler Microsoft C# .NET 6 29th Apr 2007 02:21 PM
help with stored procedure and parameters. vncntj@hotmail.com Microsoft C# .NET 2 8th Jan 2007 04:29 PM
Stored procedure with two parameters lemes_m@yahoo.com Microsoft Access 3 9th Feb 2006 11:13 AM
Stored Procedure Parameters =?Utf-8?B?Sm9obm55?= Microsoft C# .NET 1 17th Feb 2005 11:27 AM
Stored Procedure Parameters Chris Kennedy Microsoft ADO .NET 3 14th Jun 2004 06:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:56 AM.