Re: Inserted row after DB_E_ABORTLIMITREACHED

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



(dimitar.lazaroff@xxxxxxxxx) writes:
I have very strange problem. I'm inserting rows in SQL2005 database
using Native Client, sometimes I receive hresult
DB_E_ABORTLIMITREACHED with description 'Query timeout expired', and
when this happens I'm trying to insert the same row again (within the
same command and session). Sometimes (very rarely) I see that the row
is inserted twice. It looks like the row is inserted even I receive
DB_E_ABORTLIMITREACHED. I know that this sounds stupid, but I have no
idea how this can happens.

Depending on what your query batch includes that is perfectly possible.
A query timeout means that the API got tired of waiting for results
from SQL Server, and cancels the batch. Nothing is rolled back because
of this, so if any insert has been performed, it has been inserted.

Query timeouts are something you should avoid. It is not clear which
API you use. The naked OLE DB API has no query timeout by default, but
ADO has a default timeout of 30 seconds.

Set the query timeout 0, meaning wait forever.

--
Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
.



Relevant Pages

  • Re: SQL Server 2000 query time out option, what does it do?
    ... > Can anyone tell me what the query time out is for? ... The query timeout is for queries to remote servers. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)
  • Re: Cant connect to linked server
    ... "Erland Sommarskog" wrote in message ... Query Timeout: 0 ... you need to specify this in the fourh parameter to ... sp_addlinkedserver 'HOMAX01', 'SQL Server', 'SQLNCLI', 'DTSERVER2\HOMAX01' ...
    (microsoft.public.sqlserver.connect)
  • Re: REPLICATION ERROR - retention-based meta data
    ... I want to increase query timeout value but I don't how to do this. ... > SouRa, ... > Paul Ibison SQL Server MVP, ...
    (microsoft.public.sqlserver.replication)
  • Re: Sql Query
    ... We dont have an SQL server - we have an AS400 running ... Where can I download osql.exe? ... >Use osql.exe in your batch, ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Limit query execution time
    ... mention the version of SQL I am using: ... But I remember now that there was a weird bug with the query timeout in SSMS 2005. ... Erland Sommarskog, SQL Server MVP, esquel@xxxxxxxxxxxxx ... Books Online for SQL Server 2005 at ...
    (comp.databases.ms-sqlserver)