SQL Server Performance

xp_cmdshell not working

Discussion in 'T-SQL Performance Tuning for Developers' started by contactjimmyus, May 22, 2008.

  1. I am deleting restored backup files using script xp_cmdshell and it gives the meaage as access denied .I am logging into sql using windows login and sysadmin priviledge on the system and i HAVE FULL CONTRROL OF THE FOLDER WHERE THE FILE RESIDES .tHE FILE NAME IS CREATED AUTOMATICALLT
    tHE command used isselect
    @FName =filename from #JSfiles where filename like '%.RSTRD'SET @Delete = 'DEL "\B5-r1Production' + @FName + '"'
    exec master..xp_cmdshell @Delete
  2. Luis Martin Moderator

    Any error message?
    Any action, after exec, or no action at all?
  3. The error message is access denied in sql query analyser
  4. I have changed shared path to local path ie to e:production and it worked .
    Thanks a lot for your comments and suggestions
  5. What i have done is a temporory fix.I tried to delete file from the shard drive and able to do it .but it is not working from sql query analyser.THE error message was access denied .
  6. satya Moderator

    WHat is the privilege for the SQL Server service account on this shared path?

Share This Page