Monday, March 12, 2012

error occur while delete large volum records

I had write a ActiveX service to delete several tables and those records are more than 100000. When I test it by deleted 1000 records it is ok, but once the volum is increase until 100000, it will give me a error message said timeout operation fail.

how can i overcome this problem. please!!!!Are you deleting the entire table or only a part of it.|||only part of it|||Originally posted by yawhum80
only part of it

Can you post the delete query.. i believe an index would help a lot over here.|||Sub DeleteByReqID(TableName, myConn)
dim rsResult
Set rsResult = CreateObject ("ADODB.Recordset")

strSQL = "DELETE * FROM " & Trim(TableName) & " WHERE ReqID >= " & getFirstReqID & "AND ReqID <= " & getLastReqID
Set rsResult = myConn.Execute(strSQL)

Set rsResult = Nothing

End Sub|||Is reqid the primary key in this table .. if not ... a clustered index on the same would be my recomendation|||not all the table is using reqid as a primary key, may i know what is the problem?|||i mean to say that if you create a clustered index on the reqid column .. it might help speed up your query . The reason i asked whether reqid was the primary key was coz a clustered index is automatically created on the primary key column in case one doesn't exist already...

Can you post the ddl for the table|||i had test it in isql and all the datas are successful to deleted but once i using DTS ActiveX script it will pop up the error message.

no matter i using primary index, cluster index or non primary and non cluster index.

is this because the DTS ActiveX script has a time limit for a operation?

No comments:

Post a Comment