Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL Server batches
Message
De
27/01/2006 05:15:36
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Novell 6.x
Database:
MS SQL Server
Divers
Thread ID:
01090701
Message ID:
01090830
Vues:
9
>Not really sure where to put this one:
>
>I have a batch that I did as a stored procedure in SQL2000. It takes 0:02:40 to run as an SP. As a query through the Analyzer it takes all of 3 seconds and returning 1700 rows. I figured that doing it as a batch from my Fox app would be the way to go (big time difference there). When I run it as batch using SQLEXEC(), SQLEXEC() returns 1. (No errors) But I don't get any result sets.
>
>This is what I use and get a 1 back from SQLEXEC():
>
>
>? SQLEXEC(x,"Begin " + CHR(13) + CHR(10) + p + CHR(13) + CHR(10) + " END" ,'TEST')
>
>
>Within this there is the following line for parameters:
>
SET @FiscalYear = ?FY
>SET @Accounts = ?Accounts
>set @SWDNs = ?SWDN
>set @PrimaryDocs = ?PDOCs
>SET @glcs = ?GLC
>SET @Sites = ?Sites
>
>Using the Profiler, it LOOKS like Fox translates it to use sp_executesql and for the most part correctly identifies variable type and length.
>
>How do I need to put this into SQLEXEC() to get a result set back (It's supposed to return 2 of 'em) ?
>
>
>TIA,
>Richard
text to m.lcSQLBatch noshow
-- SQL commands as they appear in analyzer -- 
endtext
SQLExec(m.lnHandle, m.lcSQLBatch, 'test')
However I would check why there is such a difference between SP and batch.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform