Avatar of Dud1
Dud1
 asked on

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

Avatar of undefined
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.

thanks,
dud1
bashka_abdyli

All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Dud1

ASKER
Hi,

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).

thanks,
dud1
ASKER CERTIFIED SOLUTION
bashka_abdyli

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.