CopyFile
Copies a specified file from a local directory or supported cloud-storage provider to another location. This procedure is useful for automating data migration and replication tasks in workflows that rely on multiple storage environments.
Procedure-Specific Information
The procedure accepts the parameters
- SourcePath: path of the file you request to copy
- DestinationPath: path of the folder where you request to copy the file
- Usage of absolute path : sftp://localhost:22/folder1/file1.csv will copy the file from the source path /folder1/file1.csv .
- Usage of relative path: file1.csv will copy the file from the source path {CONNECTION STRING URI}/file1.csv If connection string has the URI set to: sftp://localhost:22/folder2, it will copy the file from the source path /folder2/file1.csv.
EXEC COPYFILE @SourcePath = 'sftp://localhost:22/folder1/file1.csv' @DestinationPath = 'sftp://localhost:22/folder2/' //absolute path
EXEC COPYFILE @SourcePath = 'file1.csv' @DestinationPath = 'folder2' //relative path
Input
| Name | Type | Description |
| SourcePath | String | Specifies the full file path of the source file that is copied from a local or cloud-based storage system. |
| DestinationPath | String | Specifies the full file path of the destination location where the copied file is written in a local or cloud-based directory. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | Indicates whether the file copy operation completed successfully. Returns a value of 'true' when the file is copied without error and a value of 'false' when a failure occurs during the process. |