December 19, 2008 at 8:36 am
Hi ,
I m using Xp_cmdshell in one of my procedure to check the existance of file.Its turned on in the configuration tools also
But its keeps on executing and I don't get any response. I need to stop the query executing.
below is my code.
Declare@File varchar(100)
set @file='C:\Mytext.text'
exec master..xp_cmdshell @File
Any Respone will be appreciated.
Thanks!
December 30, 2008 at 6:59 am
This is the problem with xp_cmdhshell, here in your case i am able to see that your just calling the xp_cmdshell with file name without anyoperating system command(eg, del, dir,ren...). This query will simply runs and never ends.
To terminate this, if you goto TaskManager on the windows you will be able to see a cmd.exe process running with the user name on which your sql server runs. You can just kill that windows process from the task manager and your spid should get killed. Dont ever run the xp_cmdshell without any process command from the sql server. this will simply opens the cmd and never gets completed.
December 30, 2008 at 1:51 pm
You response is highly appreciated.
Thank you 🙂
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply