Table as parameter

  • As far as I can tall, there's no way to pass a table or table variable as a parameter.

    Is passing in XML and parsing it really the best way?

    I guess my issue is I *want* to do some bulk inserts, but engineering requires that we do everything through their procs. The procs are designed to modify one row at a time and it can take hours for what I want to do looping through a cursor to call their procs when a simple update command would take under a second.

    Anyway, I need to create a store proc that is entirely contained, so it must only work with the parameters passed in and/or the standard tables. I need to pass in my dataset as a variable, but converting my updates into XML makes for 5MB-10MB varchars and that just seems messy.

    Is there a better way to pass in a large dataset?

    Thanks 🙂

  • Try this page

    http://www.sommarskog.se/arrays-in-sql-2005.html



    Clear Sky SQL
    My Blog[/url]

  • Here's an article on passing data as if it were a 1, 2, or 3 dimensional array...

    http://www.sqlservercentral.com/articles/T-SQL/63003/

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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