You can use Visual FoxPro SQL pass-through technology to create and execute stored procedures on a remote server. Stored procedures can greatly enhance the power, efficiency, and flexibility of SQL, and dramatically improve the performance of SQL statements and batches. Many servers provide stored procedures for defining and manipulating server database objects and for performing server system and user administration.
|The examples in this section use Microsoft SQL Server syntax unless otherwise noted.|
To call a server stored procedure
Use the SQLEXEC( ) Function with the stored procedure name.
For example, the following code displays the results of calling a stored procedure named
sp_who on SQL Server using an active connection to the data source
nConnectionHandle = SQLCONNECT('sqlremote') ? SQLEXEC(nConnectionHandle, 'use pubs') ? SQLEXEC(nConnectionHandle, 'sp_who') BROWSE
For more information on creating and executing stored procedures on a remote server, see your server documentation.