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.