Faster way to Delete record

Results 1 to 4 of 4

Thread: Faster way to Delete record

  1. #1
    ed Guest

    Default Faster way to Delete record

    I have to delete all recs in SQL database bef<BR>update all the new record fr uploaded text file.<BR>I use normal ado to connect and delete but it take quite a long time especially with large amount of rec in database.<BR><BR>Let me knoe if you have an efficient way to delete all<BR>record in database?Thanks

  2. #2
    Join Date
    Dec 1969

    Default Are you doing it like this?

    How are you deleting them? With a loop or with an execute? I would do. objConn is you connection.<BR><BR>SQL = "DELETE from Table1"<BR>objConn.Execute SQL<BR><BR>This will delete all rows. You can add a WHERE clause to this as well if you only want to delete a few records.<BR><BR>SQL = "DELETE from Table1 WHERE ColumnName = &#039string&#039"<BR>objConn.Execute SQL

  3. #3
    ed Guest

    Default RE: Are you doing it like this?

    thank..previously i am using loop, after change to look faster.<BR><BR>How about adding?after delete the data, i need to add all rec fr<BR>text delimited file to database,Currently i am using 2 connect to the file through dsn and another to database through ado.<BR><BR>Then i loop the file recordset and update row by row to database.<BR>this look pretty slow..any idea thow to improve the speed?thanks faster..<BR><BR>

  4. #4
    Garth Guest

    Default RE: Faster way to Delete record

    If you are using SQL Server try the TRUNCATE TABLE statement. It&#039s more efficient than DELETE because minimal logging occurs.<BR><BR>Garth<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts