Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Performance to SQL Server
Message
From
15/05/1998 16:51:47
 
 
To
13/05/1998 19:25:49
General information
Forum:
Visual FoxPro
Category:
Client/server
Miscellaneous
Thread ID:
00098935
Message ID:
00099866
Views:
16
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.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform