Question

  • Creator
    Topic
  • #2224685

    run SQL stored procedure from Excel

    Locked

    by highlander718 ·

    I have a stored procedure in SQL2005 that builds7refreshes a table. I cannot use SQL Views due to highly complex programming that is needed. I have an excel pivot table that uses that table afterwards.
    I would like the user to be able to refresh the data in the pivot, including of course running the SQL stored procedure and than refreshing the pivot.

    Any ideas would be highly appreciated.

All Answers

  • Author
    Replies
    • #2617744

      Clarifications

      by highlander718 ·

      In reply to run SQL stored procedure from Excel

      Clarifications

    • #2617454

      http://support.microsoft.com/kb/306125

      by highlander718 ·

      In reply to run SQL stored procedure from Excel

    • #2552930

      in SQL’s microsoft query, write stored procedure’s name

      by joaomfferreira ·

      In reply to run SQL stored procedure from Excel

      you can import:
      – table
      – query
      – default (this one)

      and write the SP name followed by parameters (comma between then).
      Example: my_Stored_Proc 1234, ‘Yes’, 2008
      Without paramenters is: my_Stored_Proc

      If you write ?EXECUTE ? before, maybe it will work also (who cares?)
      If you use microsoft Query, start by creating a new query of indiferent table.
      Edit the MS Query and change the SQL statemente from ?SELECT …something…? to your own SP, or the example ?my_Stored_Proc 1234, ‘Yes’, 2008?

      And bingo, it works.
      Im not sure if it works on Excel XP, but in 2003 and 2007 it’s a charm.

    • #3036508

      Running a Stored procedure from Excel

      by samhow ·

      In reply to run SQL stored procedure from Excel

      Hi,

      There are some Excel Add-Ins that make it easy to run a SQL stored procedure from Excel.

      The one I am most familiar with is QueryCell,(I created it).

      http://www.QueryCell.com

      But if you search for SQL in Excel other will come up also.

      Cheers
      Sam

Viewing 3 reply threads