Option available for individual query or sproc level timeout

  • Hi Team,

    Greetings!

    I'm currently working on a module where I am getting query timeout against a comparatively big data set. The data set size vary at the runtime and kind of bulk update or retrieval. I already tried DBCommand.CommandTimeout to 1800, did not help in certain cases.

    I was trying to write an sproc around this which will first determine the volume of data (by the bulk xml size or by querying the Count()). Can anyone please let me know how to set query timeout through sql in sproc.

    Thanks in advance!

    Sanjoy.

  • You don't set query timeout in a stored procedure/TSQL. Query timeout is a client setting. You were on the right track w/ CommandTimeout.

    It's not clear what you meant by "did not help in certain cases". If you mean that 1800 was not enough to prevent timeout, then determine what is and set the value sufficiently high enough.

  • Yep. Timeout is strictly a client connection setting. You can control the remote query timeout setting, but it's still very much a client-side problem. Otherwise, this sure sounds like an opportunity for good old fashioned performance tuning.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply