RenameAttachmentOrDocument
SharePoint リストやドキュメントライブラリに保存されている添付ファイルやドキュメントの名前を変更します。ファイルの内容に影響を与えずに、命名規則を標準化するのに役立ちます。
Stored Procedure-Specific Information
The RenameAttachmentOrDocument stored procedure renames a file or attachment in SharePoint. The SourceFileURL parameter specifies the path to the file to rename, and the NewFileName parameter specifies the new file name.To rename a document in a SharePoint library, enter:
EXEC RenameAttachmentOrDocument List = 'Documents', SourceFileURL = '/Shared Documents/OldName.txt', NewFileName = 'NewName.txt';
The path specified in SourceFileURL should be relative to the URL connection property.
Input
| Name | Type | Required | Description |
| List | String | True | 名前を変更するドキュメントや添付ファイルを含むSharePoint リストまたはドキュメントライブラリの名前。 |
| SourceFileURL | String | True | 接続プロパティのサイトURL に基づく、名前を変更したいファイルの相対URL。 フォーマット例: ルートディレクトリファイル:/Shared Documents/filename.txt サブディレクトリファイル:/Shared Documents/MyFolder/filename.txt 接続プロパティがサイトコレクションに設定されている場合、相対URL はベースサイト内のパスに対応します。特定のサイトを指している場合、相対URL はそのサイトからの相対URL となります。 |
| NewFileName | String | True | ファイル拡張子を含む新しいファイル名('UpdatedFilename.docx' など)。 |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | 操作が成功したかどうかを示します。ファイル名の変更に成功した場合は'true' を、失敗した場合は'false' を返します。 |