Executing Stored Procedures with More than One ParametersLast reviewed: November 2, 1994Article ID: Q74235 |
SUMMARYYou may have trouble executing stored procedures from Excel if you attempt to send more than one parameter to the stored procedure.
MORE INFORMATIONIf you are executing a stored procedure with more than one parameter, parameters after the first one may be interpreted as a FROM clause and causes the query to fail. For example, if I had a stored procedure called TEST_PROC that allowed two parameters, the following would fail:
=EXECUTE(chan,"[OPEN('TEST_PROC 12, 15')]") WorkaroundTo work around this, use the Transact-SQL statement EXEC to explicitly state that you are sending a stored procedure. The following works properly:
=EXECUTE(chan,"[OPEN('EXEC TEST_PROC 12, 15')]")For more information on using stored procedures, see pages 245-261 of the Microsoft SQL Server manual "Learning Transact-SQL."
|
KBCategory: kbother
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |