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

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 API to hook into query details and kill query

Author  Topic 

rregnier
Starting Member

1 Post

Posted - 2013-11-06 : 11:48:55
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.

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2013-11-06 : 12:05:13
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
TG
Go to Top of Page
   

- Advertisement -