How to get Excel to reliably execute sp_executesql from a query table on a worksheet?
问题 In MS Excel, if you create a QueryTable with Microsoft Query, and your SQL query cannot be visually presented by Microsoft Query, then you are not allowed to provide parameters for that query. Which is a shame, so there is this awesome technique that allows parameters anyway: {CALL sp_executesql (N'select top (@a) * from mytable', N'@a int', ?)} You provide the query in the ODBC CALL form and it works with parameters. Unless it does not. While on some computers it works flawlessly, on other