Adding records vs. Deleting records

Adding records vs. Deleting records

Post by Serge Tkacho » Thu, 01 Apr 1999 04:00:00



I wrote an ASP script to add records to a table in SQL Server 7 from a
similar table in Access - Added 35000 records in a few minutes.  Now I am
trying to delete most of those records (about 34000) and it is going VERY
SLOW, so far the script has been running for about 2 hours. Any hints as to
how to speed it up?

I use the following code:

 rs.Open "SELECT * FROM ShortStories WHERE DateTime < '"&date&"'", strDSN,
1, 3, &H0001

 Do While NOT rs.eof
  rs.Delete
  rs.MoveNext
 Loop

TIA,
-serge

 
 
 

Adding records vs. Deleting records

Post by Patrice Scrib » Thu, 01 Apr 1999 04:00:00


You may want to try a DELETE query instead...

Patrice Scribe

Serge Tkachov a crit dans le message

Quote:>I wrote an ASP script to add records to a table in SQL Server 7 from a
>similar table in Access - Added 35000 records in a few minutes.  Now I am
>trying to delete most of those records (about 34000) and it is going VERY
>SLOW, so far the script has been running for about 2 hours. Any hints as to
>how to speed it up?

>I use the following code:

> rs.Open "SELECT * FROM ShortStories WHERE DateTime < '"&date&"'", strDSN,
>1, 3, &H0001

> Do While NOT rs.eof
>  rs.Delete
>  rs.MoveNext
> Loop

>TIA,
>-serge


 
 
 

Adding records vs. Deleting records

Post by Mike » Sat, 03 Apr 1999 04:00:00


DELETE FROM ShortStories WHERE mycondition is true
should work as fast as the insert/update

>I wrote an ASP script to add records to a table in SQL Server 7 from a
>similar table in Access - Added 35000 records in a few minutes.  Now I am
>trying to delete most of those records (about 34000) and it is going VERY
>SLOW, so far the script has been running for about 2 hours. Any hints as to
>how to speed it up?

>I use the following code:

> rs.Open "SELECT * FROM ShortStories WHERE DateTime < '"&date&"'", strDSN,
>1, 3, &H0001

> Do While NOT rs.eof
>  rs.Delete
>  rs.MoveNext
> Loop

>TIA,
>-serge

 
 
 

Adding records vs. Deleting records

Post by JRSte » Sun, 04 Apr 1999 04:00:00


On Fri, 2 Apr 1999 09:36:24 -0600, "MikeC"


>DELETE FROM ShortStories WHERE mycondition is true
>should work as fast as the insert/update

I have found delete in SQL7 to run very slowly, maybe as fast as
individual inserts but far slower than global updates.

Joshua Stern

 
 
 

1. Deleting Records and adding records

I'am new to VB en and have a problem. I've made a database environment
called dbenv this is linked to a accessdb called magazijn.

On the form i've created i wanna put a button for deleting record and adding
a record. I've already made a button for navigating through the records.
with the following line: dbenv.rsleveranciers.movenext
If i try the command dbenv.rsleveranciers.delete A runtime error 3251
appears what am i doing wrong

Any help is Welcome

Michael

2. Which reporting software?

3. deleting records in a table and then adding new records

4. Error Checking SubQuery for more than 1 value

5. Cannot add record to Visual Foxpro table after deleting all records in table

6. SQL Server Licencing via Terminal Services

7. Error 3167 Record Deleted when there is no deleted record

8. ERROR: Bad timestamp external representation ''

9. Read Only problem when adding or deleting records

10. Recordset in SQL, adding, updating and deleting records???

11. Auditing record add/modify/deletes?

12. Can't delete/add records connecting through Access

13. Add, Delete and Change records......