Do you have a comment or suggestion to improve SQL Server? We’d love to hear it!

xp_delete_file on SQL Server 2017/Linux

The xp_delete_file system stored procedure for deleting bakup file does not work on Linux client OS.
Wee tested on Microsoft SQL Server 2017 (RTM-CU1) (KB4038634) - 14.0.3006.16 (X64) Enterprise Edition (64-bit) on Linux (Ubuntu 16.04.3 LTS)

Script we used :
DECLARE @BACKUP_DIR NVARCHAR(256);
EXEC master.dbo.xp_instance_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'Software\Microsoft\MSSQLServer\MSSQLServer',
@value_name = 'BackupDirectory',
@BackupDirectory = @BACKUP_DIR OUTPUT;
SELECT @BACKUP_DIR
EXEC master.sys.xp_delete_file 0, @BACKUP_DIR, N'bak', N'21111111';
GO

Error message :
Msg 22049, Niveau 15, État 0, Ligne 67
Error executing extended stored procedure: Invalid Parameter

11 votes
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    Signed in as (Sign out)

    We’ll send you updates on this idea

    SQlpro shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base