Handle infinite time running queries

  • Hi,

    I have a scenario where I need to dynamically execute SQL queries uploaded into a table.I have stored proc that fetches the record from the table and executes them through dynamic sql.

    The problem arises when the query to be executed is something that runs for a huge time.

    I need to handle the scenario where my procedure is able to tell that the particular query is a longer time running query and should switch over to the next query in the table.

  • What is a "huge" time.

    Do you want to determine for how long query will run before executing it? - I doubt you can do it, as i depends on many factors which can be even nothing to do with the query itself.

    Or, you will have estimated execution time saved alongside to the query?

    What you can do is: write application (eg. .NET) which will execute the queries from your "queue" table asynchronously. There you can check for the time it is running and cancel its execution whenever you want.

    _____________________________________________
    "The only true wisdom is in knowing you know nothing"
    "O skol'ko nam otkrytiy chudnyh prevnosit microsofta duh!":-D
    (So many miracle inventions provided by MS to us...)

    How to post your question to get the best and quick help[/url]

  • By huge time I mean some queries take more time to execute on an average say 3 min and more.These are the queries which i need to update on a log table as a long running query.

    Regarding the .Net solution, I am quite a novice in .Net. So, if you could suggest some web-site or example on this, as how to handle such kind of scenario it is appreciated.

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

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