CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2002
    Location
    England
    Posts
    66

    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
    If at first you don't succeed, skydiving is not for you.

  2. #2
    Join Date
    Apr 2002
    Location
    Melbourne, Victoria, Australia
    Posts
    1,792
    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%'

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured