Article ID: 156034
Article Last Modified on 2/12/2007
Clear
lcServername = "(local)" && change the SQL Server name if you have to.
lcDatabase = "pubs"
TEXT to lcText noshow textmerge
CREATE PROCEDURE upd_pubsauthors @state char(2), @zip char(5), @retcount int
OUTPUT AS
UPDATE authors SET state = @state
WHERE zip = @zip
SELECT @retcount = @@ROWCOUNT
ENDTEXT
Mvar = 0
nhandle=Sqlstringconnect("Driver=SQL Server;SERVER="+lcServername+";DATABASE="+lcDatabase)
=SQLExec(nhandle,'drop procedure upd_pubsauthors') = -1
If SQLExec(nhandle,lcText) = -1
Aerror(atest)
List Memory Like atest
Return
Endif
If SQLExec(nhandle,"{CALL upd_pubsauthors ('CA', '94609', ?@mvar)}") = -1
Aerror(atest)
List Memory Like atest
Else
? Mvar
Endif
Return
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.Keywords: kbautomation kbhowto kbinterop KB156034