May 20, 2014 at 10:40 am
I have a stored procedure that uses xp_cmdshell to execute an executable. I made code changes to the executable and compiled a new build. The stored procedure that uses xp_cmdshell to execute is not recognizing the code changes but when I run the same command from cmd prompt it works fine. Any ideas?
June 5, 2014 at 10:34 pm
dirk.dromgoole (5/20/2014)
I have a stored procedure that uses xp_cmdshell to execute an executable. I made code changes to the executable and compiled a new build. The stored procedure that uses xp_cmdshell to execute is not recognizing the code changes but when I run the same command from cmd prompt it works fine. Any ideas?
First thought would be more than one instance of the executable on the system.
😎
June 6, 2014 at 11:33 pm
I'm thinking the same thing. When you shell out, are you giving it the full path and filename to the executable? If not, then you're probably executing the wrong copy of it, so you're not getting the results from the new one.
June 14, 2014 at 3:10 pm
Sounds like a reason to move away from xp_cmdshell. What is the executable doing and can it be hosted on a machine other than a machine hosting SQL Server and be executed via a remote shell?
There are no special teachers of virtue, because virtue is taught by the whole community.
--Plato
June 15, 2014 at 4:57 am
Hi
When you make changes to the executable you can recompile the SP.
You could also create the SP with recompile option, so it removes and creates new plans for next executions.
Igor Micev,My blog: www.igormicev.com
June 17, 2014 at 12:20 pm
The issue was that a copy of the program that was being executed was somehow locked into cache on the server. After the program was unlocked it picked up the revised program.
June 17, 2014 at 12:25 pm
dirk.dromgoole (6/17/2014)
The issue was that a copy of the program that was being executed was somehow locked into cache on the server. After the program was unlocked it picked up the revised program.
Very curious here, could you share some details on this?
😎
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply