setting query timeout value for a single statement

  • Hellooo...

    I'm working on a stored proc which executes a remote procedure call. I want to specify a timeout value so that the remote proc call fails if it doesn't return data in 30 seconds or less.

    I know there's a way to set timeout values on the server as a whole...

    But is there a way to set this for a single statement in one stored proc, without affecting anything else on the server??

    Thanks,

    -Skip

  • Use:

    SET QUERY_GOVERNOR_COST_LIMIT

    and check in BOL for more info

  • thanks...

    does SET QUERY_GOVERNOR_COST_LIMIT take SECONDS as the supplied value?

    Just to make sure I'm understanding this correction...

    does this statement mean "kill the query (i.e. timeout) if the statement takes more than 30 seconds to complete"???:

    SET QUERY_GOVERNOR_COST_LIMIT 30

    thanks,

    -skip

Viewing 4 posts - 1 through 4 (of 4 total)

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