Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Ignore parameters with SQLExec?
Message
De
06/05/2011 16:31:18
Joel Leach
Memorial Business Systems, Inc.
Tennessie, États-Unis
 
 
À
06/05/2011 11:21:21
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Database:
MS SQL Server
Divers
Thread ID:
01509693
Message ID:
01509891
Vues:
54
>>However, the same problem does not occur if you use ADO to send the commands. Another well known issue is that you can not send commands containing GO to SQL Server. Although GO works in SSMS, it is not officially part of the T-SQL language and does not work when sent as a command. Workarounds are to send the script using SQLDMO (deprecated), SQLSMO (.NET), a command-line utility, or to parse the GOs out and send each command separately.
>
>Why separately? Just remove the lines containing the "GO" alone, and send the whole string. I sometimes have rather long ones, which return 20+ cursors, no problem at all.
>
>And, BTW, you can't have a question mark even in a comment, not even at the end of sentence. VFP's SQL engine will get completely confused with it.

There may be some unnecessary GOs, but this is a script to create the database and some are required. For example, SQL Server requires CREATE FUNCTION to be the first statement in a command, and my script contains UDFs. It's a little extra work to parse out the commands, but my code executes the script one step at a time the same way SSMS would.
Joel Leach
Microsoft Certified Professional
Blog: http://www.joelleach.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform