Bob ---
How about creating the query as a SQL-Server stored procedure, and then use SQLEXEC to execute that procedure?
>If I execute a SQLPREPARE() statement that is very long, ie, over 255 characters, I cannot get it to execute. I have not been able to confirm that there is a 255 character limit on this statement (except that it is part of a VFP statement).
>
>Is there a trick, workaround or method to execute long SQL Server statements from SQLPREPARE()?
>
>Bob
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05