Well, I'm not sure where you got that code, but it sure doesn't look like T-SQL to me!
You can send code to SQL to create stored procs from VFP either by SQL Passthrough (SQLEXEC), or by using SQL-DMO.
I have used tables to hold SQL code (in a memo field), fetched the memo into a memory variable, then fire SQLEXEC to pass it right to the server. Make sure the SP name is prefixed with "dbo." to identify the owner of the SP as the system!
Dan LeClair
www.cyberwombat.comSET RANT ON - The Wombat BlogLife isn’t a morality contest and purity makes a poor shield. - J. Peter MulhernDisclaimer: The comments made here are only my OPINIONS on various aspects of VFP, SQL Server, VS.NET, systems development, or life in general, and my OPINIONS should not be construed to be the authoritative word on any subject. No warranties or degrees of veracity are expressed or implied. Void where prohibited. Side effects may included dizziness, spontaneous combustion, or unexplainable cravings for dark beer. Wash with like colors only, serve immediately for best flavor.