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
 sql

Author  Topic 

kavi123
Starting Member

6 Posts

Posted - 2007-11-06 : 17:03:00
i have a question like when query in sql is running for long time then how to stop that?
Thanx

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2007-11-06 : 17:16:58
If you are using SSMS or EM, just press STOP button.



E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-11-06 : 17:23:51
use sp_who to find out the spid and

kill <spid>


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

Van
Constraint Violating Yak Guru

462 Posts

Posted - 2007-11-06 : 17:27:44
Or if you know the app that's causing the issue and the pc it's coming from, just close the app or reboot that pc.

I had a SPID blocking once years ago, had been doing it for several minutes when it was brought to my attention that there was an issue. When this would happen at this particular company, it would block everyone from working. So I did as I always was told to do and tried to kill the SPID. Didn't work, next course of action I was taught, stop and restart SQL server (this was back in sql6.5 days). I did this...took 44 hrs to recover the db. Turns out the issue was a corrupt index on a large table. Long story short...be careful killing stuff but it's generally ok.
Go to Top of Page

kavi123
Starting Member

6 Posts

Posted - 2007-11-06 : 19:01:16
thnx evryone ..bt could u also pls tell me how to stop sql server from control panel.
Thanx
Go to Top of Page

KenW
Constraint Violating Yak Guru

391 Posts

Posted - 2007-11-07 : 14:46:53
quote:
Originally posted by kavi123

thnx evryone ..bt could u also pls tell me how to stop sql server from control panel.
Thanx



Open Control Panel. Double-lick "Administrative Tools". Double-click "Services". Find the SQL Server service, click on it, and then click on "Stop".
Go to Top of Page

kavi123
Starting Member

6 Posts

Posted - 2007-11-07 : 17:07:58
thanq .
Go to Top of Page
   

- Advertisement -