ADO.NET Provider for Microsoft SharePoint

Build 25.0.9539

MoveAttachmentOrDocument

Moves an attachment or document from one folder to another within SharePoint. Useful for reorganizing content and maintaining a structured document library.

Stored Procedure-Specific Information

The MoveAttachmentOrDocument stored procedure moves a file or attachment to a different location within SharePoint. The SourceFileURL parameter specifies the path to the source file, and the DestinationFolderURL parameter specifies the destination folder path.

To move a document to a different folder within the same library, enter:

EXEC MoveAttachmentOrDocument List = 'Documents', SourceFileURL = '/Shared Documents/Dummy_000.txt', DestinationFolderURL = '/Shared Documents/Archive/';

The paths specified should be relative to the URL connection property.

Input

Name Type Required Description
List String True The name of the SharePoint list or document library from which the document or attachment will be moved.
SourceFileURL String True The relative URL of the source file, based on the site URL in the connection properties.

Example formats:
Root Directory file:/Shared Documents/filename.txt
Sub-directory file:/Shared Documents/MyFolder/filename.txt
If the connection property points to a site collection, the relative URL corresponds to a path within the base site. If it points to a specific site, the relative URL is relative to that site.
DestinationFolderURL String True The relative URL of the destination folder where the document or attachment should be moved.

Example formats:
Root Directory:/Shared Documents/
Sub-directory:/Shared Documents/MyFolder/
As with SourceFileURL, the relative URL depends on whether the connection property is set to a site collection or a specific site.

Result Set Columns

Name Type Description
Success Boolean Indicates whether the operation was successful. Returns 'true' if the move was completed successfully, otherwise 'false'.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 25.0.9539