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
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 xp_cmdshell procedure being dropped

Author  Topic 

deaninkc
Starting Member

3 Posts

Posted - 2008-06-13 : 12:54:12
I got a call from a new customer with an existing SQL 2000 database and a developer from Poland that suddenly decided to go back home. The classic ASP based application uses the extended procedure xp_cmdshell to launch a Window script. Randomly during the day the procedure is being dropped and the only way to get it working again is to add it at the command line via exec sp_addextendedproc 'xp_cmdshell', 'xplog70.dll'. Any idea what may be happening to drop it? There have been no new patches or updates recently and the people maintaining the network, hardware and op sys say nothing has changed. My first though was there was some ant-virus software that may be dropping it for security reasons but I have not uncovered anything yet. I'm doing this remotely and can't get on site for a week. I know the long term fix is to get ride of the xp_cmdshell call but I need a quick fix until I can get up there.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-06-13 : 13:31:06
Run SQL Profiler to catch what is happening.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

deaninkc
Starting Member

3 Posts

Posted - 2008-06-24 : 16:51:45
I used SQL Profiler and could not see where the xp_cmdshell is being dropped. They have been getting around it by using the sp_addextendedproc 'xp_cmdshell' and had other more pressing problems but now I am back on it. The dropping of the extended procedure seems to be quite random. My first instinct is to blame Microsoft but there are no similar problems in the knowledgebase and I assume they have dropped support on SQL 2000 by now. I'm working on a rewrite but they programmed themselves into a corner so I need to rip up a lot of code to make it work without a SP.
Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-06-24 : 23:17:13
Profiler will not tell you what happened before, you need run it until catch the event you traced for.
Go to Top of Page

deaninkc
Starting Member

3 Posts

Posted - 2008-07-02 : 16:39:21
Still have the issue. Its only happening once a day at random times or sometimes only once every two days. Its not practical to use Profiler. I'm thinking of calling the addextendedproc before the xp_cmdshell from the stored procedure but it give me an error saying the procedure can only be added from the master DB. Is there way of calling a procedure in the master DB from a sp in a user database? I'm working on a better solution but its going to take a while.

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-07-03 : 01:03:59
You can execute code in master while in another database by using dynamic SQL with sp_executesql.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -