Select the product you need help with
- Internet Explorer
- Windows Phone
- More products
How to pass parameters to a SQL Server stored procedure
Article ID: 247370 - View products that this article applies to.
This article was previously published under Q247370
There are two ways to pass parameters to a stored procedure using SQLExec. One way, which works across all versions of Visual FoxPro, is to build the SQL command as a string variable. The advantage of this method is that you can check the string and see exactly which SQL command you are passing to the back end.
The other way is to pass the Foxpro variables preceded with question marks, as in a parameterized view. In Visual FoxPro version 5.0 and later versions, this allows you to obtain values from the stored procedure that are being returned as output parameters.
Follow these steps:
For additional information on calling Stored Procedures, click the article numbers below to view the articles in the Microsoft Knowledge Base:
(http://support.microsoft.com/kb/156034/EN-US/ )How To Retrieve Information from SQL Server on Rows Affected
(http://support.microsoft.com/kb/177056/EN-US/ )PRB: Return Parameter Variable Name for SQL Server Causes Error
(http://support.microsoft.com/kb/114787/EN-US/ )How To Execute a Stored Procedure on SQL Server
(c) Microsoft Corporation 1999, All Rights Reserved. Contributions by Garrett Fitzgerald, Microsoft Corporation.
Article ID: 247370 - Last Review: January 24, 2005 - Revision: 3.4