Article ID: 156034 - View products that this article applies to.
This article was previously published under Q156034
Microsoft SQL Server and other server data sources frequently have statistical information about how many rows were affected by a particular SQL statement when it was executed. Microsoft Visual FoxPro 7.0 and later versions do not retrieve this information from the server for you. This article describes how to integrate using stored procedures on the server to retrieve this information.
When you are working with data on a server, you must know how many rows in the table were affected by a certain SQL command. This information is similar to the information that is provided by the _TALLY variable in Visual FoxPro.
This information is not available to you directly in Visual FoxPro, but there are ways to obtain that information if you want.
Visual FoxPro 7.0 and later versions support output parameters from stored procedures. This means that you can call a procedure that is located on the SQL Server-based computer and then that procedure returns information to the client application.
The following code example uses an existing table in the SQL Server Pubs database and creates the stored procedure on the SQL Server-based server. Create a program in Visual FoxPro, copy the code into the program, and then run the program from the Visual FoxPro Command window:
After the code runs, view the value that is echoed to the Visual FoxPro desktop. This value indicates the number of rows in the SQL Server table that are affected.
For more information about SQL Server stored procedures, see Microsoft SQL Server manuals.
Article ID: 156034 - Last Review: February 12, 2007 - Revision: 3.4
Contact us for more help
Connect with Answer Desk for expert help.