Killing long SQL Server operations from

I've a request from management, but it raises flags for me, so I'm curious if I'm right or wrong about it.

From our Windows code, some searches may take a long time to run, given certain params that users may customly create. What management wants is "after clicking a search, add a pop-up with a Cancel button to allow users to cancel the operation if they feel it's taking too long." (And yes, we optimize where we can, so moving on...)

First, after I execute a proc or query command from to the SQL DB, how then can I tell SQL Server to stop it?

And second, if I can do this, is it a potential problem? It seems that enabling excessive "kill" commands (or whatever it may be called) to our users in a multi-user environment isn't the wisest thing to do, but maybe I'm wrong. Thoughts?
Who is Participating?
Vitor MontalvãoMSSQL Senior EngineerCommented:
You don't need to kill the process. There's a cancel method for ADO.NET objects.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.