Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL server. How to DELETE 1 million rec?
Message
De
30/12/1999 14:01:29
Oleg Khvalin
The Sutherland Group Ltd
Rochester, New York, États-Unis
 
 
À
30/12/1999 13:40:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00310564
Message ID:
00310598
Vues:
18
>>Hi all,
>>Every 2-3 weeks I load 0.5-1.5 million rec into server table and delete "expired" records. I delete records from server table using BCP+Fox solution (DROP INDEX for all of them, BCP the whole table (3-5 mln rec) out, APPEND FROM tblOld.txt FOR myConditions to Fox table, COPY TO tblNew.txt, TRUNCATE server table, BCP in, CREATE INDEX ).
>>It works good enough and using BCP+Fox I avoid transaction log nightmare that kills all SQL Server solutions I tried, but I am still interested in "Server only" solution and wondering how others deal with such problem.
>>TIA and Happy New Year!
>>Oleg
>
>Have you tried SQL Passthru?
>nhandle = sqlconnect("mydatasource")
>? sqlexec(nhandle, "Delete from mytable where expired")
>? sqldisconn(nhandle)
>
>I have no idea what the performance will be like, but it works pretty fast on SQL Anywhere.


It is acceptable if you delete 100,000, but for 1,000,000 takes forever plus transaction log headaches.
Thanks,
Oleg
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform