DeleteFile
Removes a file from a local folder or supported cloud-storage provider. This procedure helps maintain storage hygiene by programmatically deleting obsolete or temporary files from integrated systems.
Procedure-Specific Information
The procedure PATH parameter accepts relative and absolute paths to the file you request to delete
- Usage of absolute path : sftp://localhost:22/folder1/file1.csv will delete the file in the path /folder1/file1.csv .
- Usage of relative path: file1.csv will delete the file in {CONNECTION STRING URI}/file1.csv If connection string has the URI set to: sftp://localhost:22/folder2, it will delete the file in the path /folder2/file1.csv.
EXEC DELETEFILE @PATH = 'sftp://localhost:22/folder1/file1.csv' //absolute path
EXEC DELETEFILE @PATH = 'file1.csv' //relative path
Input
| Name | Type | Description |
| Path | String | Specifies the full file path of the file that is to be deleted. The path is relative to the directory that is defined in the URI connection property. |
Result Set Columns
| Name | Type | Description |
| Success | Bool | Indicates whether the delete operation completed successfully. The Success output returns a value of 'true' when the file is deleted without error and a value of 'false' when a failure occurs, in which case the Details output provides additional information. |
| Details | String | Provides detailed information about any execution failure that occurs during the delete operation. The Details output returns a NULL value when the Success output is true. |