Cannot find the function xp_cmdshell in the library...

  • "Cannot find the function xp_cmdshell in the library C:\Program Files\Microsoft SQL Server\MSSQL\Binn\sqlatxss.DLL. Reason: 127(The specified procedure could not be found.)."
      Who knows why I get this errur during part of my sql to create a backup job.  I believe the following line(s) of code are failing when it attempts to create a directory:
     
      declare @RegSQL varchar(1000)

      /*

       If it does not exist, create the directories for backups

      */

      set @RegSQL = 'exec master..xp_cmdshell ''if not exist "' + @BackupDir + '" md "' + @BackupDir + '"'''

      exec (@RegSQL)

    I'm afraid the problem is related to my user's "security" settings.  Any ideas?
     
  • From BOL:

    When xp_cmdshell is invoked by a user who is a member of the sysadmin fixed server role, xp_cmdshell will be executed under the security context in which the SQL Server service is running. When the user is not a member of the sysadmin group, xp_cmdshell will impersonate the SQL Server Agent proxy account, which is specified using xp_sqlagent_proxy_account. If the proxy account is not available, xp_cmdshell will fail. This is true only for Microsoft® Windows NT® 4.0 and Windows 2000. On Windows 9.x, there is no impersonation and xp_cmdshell is always executed under the security context of the Windows 9.x user who started SQL Server.

    Enjoy

    Quand on parle du loup, on en voit la queue

  • thank you.  I discovered this intersting bit of info.  if I run sp_helpextendedproc, I see xp_cmdshell contained in xplog70.dll.  not sqlatxss.dll, as my users system was reporting.  Is simply due to some nested function calls and dependencies, or is their system whacked??  also, does "xp_cmdshell will fail" mean that I would get the error I'm getting? 
     
    I hate security
     
  • Have this problem solved?

  • It's been a while since I worked with this, but there's a good chance this was related to another issue I was having with xp_sqlmaint.  The cause of that problem was determined to be the original installation of MSDE NOT being done as a local administrator.  There are also some options on the MSDE install that can/should be set to ensure this.  this was the other posting I had regarding my troubles.
     

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply