Wednesday, August 29, 2012

MSSQL - [ODBC SQL Server Driver] invalid parameter number

This is the error when trying to load external data from external source using parameterized SQL into Excel.  To parameterize your SQL you have to use "From Microsoft Query."  This is the only external source that accepts parameters in Excel 2010.


In the example above, I setup a connection properties to call a stored procedure with 3 parameters and I keep getting the "Invalid parameter number" error.  As it turns out, the user doesn't have enough permission to execute the stored procedure but the error certainly misled me and wasted a lot of time on it.







3 comments:

  1. At last I have found an answer. What a useless error message.

    ReplyDelete
  2. Hi there, I just ran into the same issue and am hoping the cause is the same. Can you let me know what permissions the user required in order to be able to run the stored procedure query?

    ReplyDelete