FileEncrypt
Encrypts a single File
- Stored Procedure
- SQL Server Compatibility: 2008, 2012, 2014, 2016, 2017
EXEC SQLHTTP.net.FileEncrypt @SourceFilePath, @DestinationFilePath, @SecretKey
Name | Type | Description |
---|---|---|
@SourceFilePath | varchar(MAX) | Full path to the existing source file |
@DestinationFilePath | varchar(MAX) | Full path to the non-existing destination file |
@Secret Key | nvarchar(MAX) | Case sensitive password |
Accessing the file system will be performed in the context of the SQL Server instance process. You can set SQL Server to run using a specific network account, or a Local System Account.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
DECLARE @SourceFilePath varchar(MAX) DECLARE @DestinationFilePath varchar(MAX) DECLARE @SecretKey nvarchar(MAX) --Assign a path to a file that the executing user has read permissions on SET @SourceFilePath = 'C:\ThisFolderExists\ThisFileExists.pdf' --Assign a path to a file that the executing user has write permissions on SET @DestinationFilePath = 'C:\ThisFolderExists\ThisFileDoesNotExist.pdf' SET @SecretKey = 'This can be a very long password' EXEC SQLHTTP.net.FileEncrypt @SourceFilePath, @DestinationFilePath, @SecretKey |
1 2 3 |
Command(s) completed successfully. |
- CodePageEncodings
- FileCopy
- FileDecrypt
- FileDelete
- FileEncrypt
- FileMove
- FileRead
- Files_To_Table
- FileWrite
- FolderCopy
- FolderCreate
- FolderDelete
- FolderMove
- Folders_To_Table
- GlobalTable_To_File
- IsExistingFile
- IsExistingFolder
- TempPath
- ZipEntryAppend
- ZipEntryRemove
- ZipExtract_To_Folder
- ZipExtract_To_Table