-
SQL Server question
Hi all,
Wasn't sure where to put this so here it is.
Is it possible in SQL Server 7.0 to extract stored procedure parameters from one of the system tables?
The reason I ask is that I've written an ADO class in VB and want to write a method to execute a stored procedure. I don't want the user to have to specify the size, type, etc for each parameter. I want them to be able to just pass values to the stored procedure and the class to determine what type it is.
Any thoughts greatly appreciated.
Rob
-
This works on Sybase - should also work on SQL Server
Code:
SELECT a.name 'procedure'
, b.colid 'position'
, b.name 'parameter'
, c.name 'type'
, b.length
, b.prec
, b.scale
FROM sysobjects a
, syscolumns b
, systypes c
WHERE a.id = b.id
AND b.usertype = c.usertype
AND a.type = 'P'
AND a.name like '%proc_name%'