Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP Performance to SQL Server
Message
De
15/05/1998 16:51:47
 
 
À
13/05/1998 19:25:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00098935
Message ID:
00099866
Vues:
17
sorry about the delay, i was out of town yesterday.

the code is pretty straight-forward:

******

hnd = sqlstringconnect(...)
=sqlsetprop(hnd, "transactions", 2) && manual transactions
ireccount = 0

select localtable
scan
csql = "insert into table (field1, field2, field3, ...) " + ;
"values (?localtable.field1, ?localtable.field2, ?localtable.field3, ...)"
iretval = sqlexec(hnd, csql)
ireccount = ireccount + 1

if ireccount = 2000 then
=sqlcommit(hnd)
ireccount = 0
endif

select localtable
endscan
=sqlcommit(hnd)

******

i guess i could use a bulk copy, but localtable is created programmaticall, and i would have to shell out to do a bcp. also, i've had a hard time getting bcp to work right, and did not want to introduce more problems into my code.

i've put in the transactions so that i don't overload the sql server logging (wonder if that might be an issue).

so localtable is written completely to the back-end table. the server table has indexes on it, which would slow down the insert over time, but i don't really have any control over that - i can't afford to recreate the indexes every time (or maybe there is an alternative?).

thanks for your comments and help. hope my question is clearer.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform