Abort sql query in the middle of the execution process.
Hi,
I want to abort my sql query in the middle of the execution process,how can i do it?
I 'am using ADO.Net with sql server 2005.
thank,
dud1
.NET ProgrammingMicrosoft SQL Server 2005
Last Comment
bashka_abdyli
8/22/2022 - Mon
bashka_abdyli
You will have to use threads. The execution of an SQL Statement should be done with a thread. This will give you options to execute other code without depending on the thread results. You could then kill this thread and close database connection.
Dud1
ASKER
Hi,
This is not the solution that I look for,there is any other way to do this,I mean stop/abourt query without to force the connection to close.
I try to be more specific ,My problem is that the sql query execution can take alot of time,and meanwhile the user can decide that he doesn't wants this query resualt, he wants to abort is request, and request for another qeury result.
My request is to know how to do it like sql server managment studio,it's mean to abort the query in the middle,without waitting for the query finished to run(The problem isn't to do this async,the problem that even it will run in backstage it will consume process time).