Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Most effective way to insert many recs to SQL Server?
Message
 
À
20/08/1998 11:31:23
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00127997
Message ID:
00128686
Vues:
41
>Hi jayesh! I was reading your reply to Chris and I have the same problem. I want to insert a cursor into the SQL. Can we send the cursor in one shot?
>Before I read this message, I tried the same that suggest to chris. I made a remote view from the SQL. After that I execute an append from my_cursor (into the view of course). Then I execute a TableUpdate. It's was very bad!. It's not true that the cursor goes in one shot. I open the SQL trace application and I saw 20000 lines Insert into my_table Values(...). Maybe I configured in a wrong way the remote view. What do you recommend me? Asyncronicus, batchmode?
>However, I also tried with a DoWhile, Sqlexec (Store procedure) EndDo and It's faster then the remote view. Anyway,... I would like to send the cursor directly, in one shot, and I think that maybe there is a command in ODBC like the Call or something.
>
>So, What do you suggest?


Hello Roberto,

When you issue TABLEUPDATE() each time it internally INSERTs/COMMITs the record. Instead of this insert all the records in the remote view and INSERT/COMMIT them in just one shot by issuing TABLEUPDATE at the end.
If you see this via SQL-Trace you will surely find INSERT statements for each
record. I thought this would be faster then each INSERT/COMMIT. but as you tried
SQLEXEC() in SCAN ENDSCAN and it faster the the batch update.
Asyncronicus, batchmode properties do not affect the INSERT and there is no way in SQL Server/ODBC where you can setup this option. I would suggest you to stick
to
SCAN
=SQLEXEC()
ENDSCAN

Though I will try Batchmode and get back to you ASAP.

Bye
Jayesh
- Jayesh
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform