SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    SitePoint Zealot moretea's Avatar
    Join Date
    Jun 2004
    Texas, USA
    2 Post(s)
    0 Thread(s)

    SQL Server 2005: passing params to SP by reading from a file?

    We already have stored procedures in place to update or insert to a table; what we would like to do now is to pass in an .XLS (or whatever) with the associated parameters, from which SQL Server could read row by row and determine which SP to run. Something like this...

    Code SQL:
    SP      sessionID  facilityID  category  mfr          model          num_units
    UPDATE  10001      100         sedan     Ford         Taurus         3
    UPDATE  10003      105         sedan     Honda        Accord         -2
    INSERT  10010      107         minivan   Chrysler     T&C            2
    UPDATE  10015      110         pickup    Dodge        Ram            1
    INSERT  10020      113         pickup    Chevrolet    Silverado      3
    UPDATE  10022      117         suv       Toyota       RAV4           -1

    We have about 1000+ rows of data to be either updated or added; surely this can be automated in this way, can't it? TIA for your help!
    Last edited by moretea; Oct 19, 2009 at 17:04. Reason: font formatting mistake

Tags for this Thread


Posting Permissions

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