Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 API to hook into query details and kill query
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

1 Posts

Posted - 11/06/2013 :  11:48:55  Show Profile  Reply with Quote
Periodically our application experiences large memory spikes due to faulty coding. I would like to configure SQL Server so that any query that is returning more than X MB of memory should be terminated with a special message indicating that the query was terminated in order to protect the application server from a memory explosion. Does such a tool exist? Are there APIs that I can hook into to write such a tool? Same thing for queries that are taking longer than X seconds, have SQL Server kill them.

Flowing Fount of Yak Knowledge

6065 Posts

Posted - 11/06/2013 :  12:05:13  Show Profile  Reply with Quote
Are you trying to limit the amount of memory a given statement is consuming on the sql server?
Or are you trying to limit the amount of data that is returned to the application server?

In either case I don't know of a server setting to limit that. Closest thing I can think of is "query governor cost limit" but that is more of a time limit thing.

>>due to faulty coding
I'm afraid your best option is to fix the code. Is this in-line sql in application code or are you calling stored procedures?

Be One with the Optimizer
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.02 seconds. Powered By: Snitz Forums 2000