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
 Old Forums
 CLOSED - General SQL Server
 Could not find stored procedure 'xp_cmdshell'

Author  Topic 

TAS
Yak Posting Veteran

65 Posts

Posted - 2004-08-19 : 15:12:25
I run this:

DECLARE @result int
EXEC @result = xp_cmdshell 'dir *.exe'
IF (@result = 0)
PRINT 'Success'
ELSE
PRINT 'Failure'


I got result like this:

Server: Msg 2812, Level 16, State 62, Line 2
Could not find stored procedure 'xp_cmdshell'.
Failure


Anyone knows why?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-08-19 : 15:29:47
xp_cmdshell exists in master. So if you are in a different database, then use the 3 part naming convention for it:

master.dbo.xp_cmdshell

Tara
Go to Top of Page
   

- Advertisement -