Passing datatable (collection) as parameter in stored procedure???

  • How can i pass datatable or collection as parameter in a stored procedure in SQL Server 2000? Please help...

  • 1) Cursors are passable as parameters, although VERY inefficient.

    2) You could shred the data into XML and pass a text type parameter with the xml, reshread it in the sproc into a temp table/table variable and go from there.

    3) Put the data into a temp table, which is usable by subordinate sproc calls internally.

    4) If you just need a collection such as an array, search for sp_OA... stuff for array usage (ken henderson has such I believe).  Or construct a delimited char-type variable and pass that.

    Best,
    Kevin G. Boles
    SQL Server Consultant
    SQL MVP 2007-2012
    TheSQLGuru on googles mail service

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply