SQL0666 - SQL query exceeds specified time limit or storage limit

Isaac Levin picture Isaac Levin · Feb 24, 2011 · Viewed 18.9k times · Source

Periodically, I get this error message while making a call to a DB2 database using the Odbc connection string. I have tried setting the CommandTimeout of the DbCommand object to multiple values, but I still get the following error.

SQL0666 - SQL query exceeds specified time limit or storage limit.

Is there a trick to getting this to stop erroring out. It is very odd because the same query sometimes will work and sometimes will timeout. Any help would be appreciated. Thanks!

Answer

kite picture kite · Mar 3, 2011

I have tried setting the CommandTimeout of the DbCommand object to multiple values

I set the DbCommand.CommandTimeout= 0 and this fixed the timeout error