Skip to content

Instantly share code, notes, and snippets.

@a-sitnikov
Created May 23, 2017 12:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save a-sitnikov/3f1fc1df35fd1cec45ad109ba99bb5ea to your computer and use it in GitHub Desktop.
Save a-sitnikov/3f1fc1df35fd1cec45ad109ba99bb5ea to your computer and use it in GitHub Desktop.
Delete file on MS SQl server via sql
EXEC sp_configure 'show advanced options', 1
RECONFIGURE
EXEC sp_configure 'xp_cmdshell', 1
RECONFIGURE
EXEC xp_cmdshell "del /Q E:\Temp\erp.bak"
EXEC sp_configure 'xp_cmdshell', 0
RECONFIGURE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment