DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Ellen Khlystova Guest

    Array as a parameter to stored procedure.

    Is it possible to accept an array ( or any data structure representing
    an ordered set ) as an input parameter in a stored procedure? The
    number of elements will vary from call to call.

    DB: MS SQL 7 on NT

    Thanks.
    Ellen.



  2. #2
    Phil Kerkel Guest

    Re: Array as a parameter to stored procedure.


    No, SQL Server does not support any array parameters.

    The only workaround I know of is to pass a delimited string of values into
    a stored procedure, create a #temp table, then inside of a while loop parse
    the values into the temp table.

    Ellen Khlystova <ekhlystova@ksminc.com> wrote:
    >Is it possible to accept an array ( or any data structure representing
    >an ordered set ) as an input parameter in a stored procedure? The
    >number of elements will vary from call to call.
    >
    >DB: MS SQL 7 on NT
    >
    > Thanks.
    > Ellen.
    >
    >



  3. #3
    Phil Kerkel Guest

    Re: Array as a parameter to stored procedure.


    No, SQL Server does not support any array parameters.

    The only workaround I know of is to pass a delimited string of values into
    a stored procedure, create a #temp table, then inside of a while loop parse
    the values into the temp table.

    - Phil

    Ellen Khlystova <ekhlystova@ksminc.com> wrote:
    Is it possible to accept an array ( or any data structure representing an
    ordered set ) as an input parameter in a stored procedure? The number of
    elements will vary from call to call.

    DB: MS SQL 7 on NT

    Thanks.
    Ellen.

  4. #4
    Ellen Khlystova Guest

    Re: Array as a parameter to stored procedure.

    Phil,
    Thanks for the prompt reply.

    I already parse a NVARCHAR ( 511 ) string, but this is not an "elegant"
    solution...


    Ellen.


  5. #5
    DaveSatz Guest

    Re: Array as a parameter to stored procedure.

    check out http://www.mssqlserver.com/faq/development-array.asp

    "Ellen Khlystova" <ekhlystova@ksminc.com> wrote in message
    news:3A6F3EDF.17E0F8E6@ksminc.com...
    > Is it possible to accept an array ( or any data structure representing
    > an ordered set ) as an input parameter in a stored procedure? The
    > number of elements will vary from call to call.
    >
    > DB: MS SQL 7 on NT
    >
    > Thanks.
    > Ellen.
    >
    >




Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links