3 Protocol Details
3.1 Server Details
3.1.4 Message Processing Events and Sequencing Rules
3.1.4.10 proc_CascadeDeleteItems
@SiteId: The site collection identifier of the site collection which contains the specified document.
@DocId: The document identifier (2) of the document associated with the file fragment being updated.
@DocVersion: This parameter MUST be ignored.
@UserId: This parameter MUST be ignored.
@Partition: The Identifier for a file fragment partition of the partition (2) to which the file fragment being updated belongs.
@Id: The file fragment identifier of the file fragment to update.
@BlobData: The data to append to the existing data of the file fragment.
@BlobSize: The size in bytes of the data being appended.
Return values: An integer that MUST be listed in the following table.
Value Description
0 Successful execution.
33 The file fragment being updated with values @DocId, @Partition, @Id could not be found.
4317 The file fragment data being updated resulted in an IO error or constraint violation.
Result Sets: MUST NOT return any result sets.
3.1.4.10 proc_CascadeDeleteItems
The proc_CascadeDeleteItems stored procedure is called to perform a cascading delete operation. The T-SQL syntax for the stored procedure is as follows:
PROCEDURE proc_CascadeDeleteItems (
@SiteId uniqueidentifier, @WebId uniqueidentifier, @ParentListId uniqueidentifier, @ParentItemId int,
@ParentUrl nvarchar(260), @ParentServerTemplate int,
@ParentBaseType int,
@ParentEventData varbinary(max), @ParentAcl varbinary(max), @ParentNeedsAuthorRestriction bit,
@ParentListDeletedUrls bit, @ParentListItemVersion bit,
@UserTitle nvarchar(255), @UserId int,
@QueryAuditFlags bit, @LogChange bit, @ThresholdRowCount int,
@CsvListItemString nvarchar(max), @DeleteOp int,
@FailedUrl nvarchar(260) = null OUTPUT, @DeleteTransactionId varbinary(16) = 0x OUTPUT );
@SiteId: The site collection identifier of the site collection containing the specified list (1).
@WebId: The site identifier of the site (2) containing the specified list (1).
@ParentListId: The list identifier of the list (1) containing the parent item of the cascading delete operation.
@ParentItemId: The list item identifier of the parent item of the cascading delete operation.
@ParentUrl: The store-relative form Uniform Resource Locator (URL) of the parent item of the cascading delete operation.
@ParentServerTemplate: The identifier for the list template that defines the base structure of the specified list (1).
@ParentBaseType: The base type of the list (1) containing the parent item of the cascading delete operation. It MUST NOT be NULL and MUST be one of the values specified in [MS-WSSTS]
section 2.5.
@ParentEventData: The parameter contains implementation-specific event data significant to the front-end Web server but otherwise opaque to the back-end database server, to be stored by the back-end database server for eventual writing to the change log.
@ParentAcl: The binary serialization of the Window SharePoint Services ACL Format ACL for the data supplied in @ParentEventData. It can be NULL. For more information regarding this ACL Format, see [MS-WSSFO2] section 2.2.4.6.
@ParentNeedsAuthorRestriction: A bit flag to specify whether to verify if the current user specified by @UserId is the author of the parent item of the cascading delete operation. If this is 1 and the current user specified by @UserId is not the author of the parent item of the cascading delete operation, the stored procedure MUST NOT complete successfully. If @ParentBaseType is 1, this bit MUST be set to NULL.
@ParentListDeletedUrls: A bit flag to specify whether the Deleted Documents Result Set (section 3.1.4.10.1) MUST be returned as a result of successfully deleting the parent item of the cascading delete operation. If the Deleted Documents Result Set MUST be returned, this MUST be set to 1, otherwise this MUST be set to zero. If @ParentBaseType is not 1, this bit MUST be set to zero.
@ParentListItemVersion: An optional value to compare with the version number of the list item.
It can be NULL. If this parameter is not NULL, the parameter MUST match the version number for successful completion.
@UserTitle: The display name of the current user. This parameter MUST be ignored.
@UserId: The identifier of the current user. This value MUST NOT be NULL. This value MUST be the user identifier of a user that belongs to the specified site collection.
@QueryAuditFlags: A bit flag to specify whether an audit entry MUST be created for the cascading delete operation. If this is 1, an audit entry MUST be created for the cascading delete operation. If this is zero, an audit entry MUST NOT be created for the cascading delete operation.
@LogChange: A bit flag to specify whether the change log MUST be updated. If this is 1, the change log MUST be updated. If this is zero, the change log MUST NOT be updated.
@ThresholdRowCount: If the current user has permissions to ignore the throttle restrictions, this MUST be zero; otherwise this MUST be the throttling limit. If the value is not zero, then the stored procedure MUST NOT complete the cascading delete operation successfully and return the error code 36 if the number of documents deleted by the deletion of any child item or the parent item in the cascading delete operation exceeds the value of this parameter.
@CsvListItemString: A parameter specifying the collection of child items to be deleted in the cascading delete operation. This parameter MUST conform to the following ABNF:
CsvListItemString = ListAndListItems 0*("," $ "," ListAndListItems ) ListAndListItems = ListId 1*("," ListItemId)
ListId = GUID
ListItemId = 1*DIGIT
GUID = "{" GUIDCORE "}" / GUIDCORE
GUIDCORE = 8HEXDIG "-" 4HEXDIG "-" 4HEXDIG "-" 4HEXDIG "-" 12HEXDIG
The ListId MUST specify the list identifier containing the child item of the cascading delete operation. The ListItemId MUST specify the list item identifier of the child item and MUST be greater than zero and less than 2,147,483,648.
@DeleteOp: A value specifying the type of delete operation to attempt. The value MUST be one of the values listed in the following table.
Value Description
3 Deleting the child items and parent item of the cascading delete operation without placing them in the Recycle Bin.
4 Deleting the child items and parent item of the cascading delete operation and placing them in the Recycle Bin. This value MUST be set only if the Recycle Bin is available.
@FailedUrl: An output parameter indicating the URL at which the delete operation failed. This parameter MUST be set to NULL if the deletion was successful.
@DeleteTransactionId: An output parameter used to identify all list items, documents or folders deleted as part of the cascading delete operation. If @DeleteOp is 4, @DeleteTransactionId MUST be set to a unique delete transaction identifier. Otherwise, it MUST be ignored.
Return values: An integer that MUST be in the following table.
Value Description
0 Successful execution.
3 The parent item or one of the child items of the cascading delete operation could not be found.
Value Description
5 The current user specified by @UserId is not same as the author of the parent item of the cascading delete operation when @ParentNeedsAuthorRestriction is set to 1.
33 While deleting the parent item of the cascading delete operation, an attempt is made to delete folders that contain checked out files.
36 The number of rows deleted by deleting any child item or the parent item of the cascading delete operation exceeds @ThresholdRowCount.
1150 Concurrency violation. The @ParentListItemVersion parameter does not match the version number of the parent item of the cascading delete operation. This value MUST only be returned if the @ParentListItemVersion parameter is not NULL.
1359 An internal error occurred, or bad parameter was specified.
6009 While deleting the parent item of the cascading delete operation, an attempt is made to delete folders that contain files that are in read-only mode.
Result sets: MUST return the Deleted Documents Result Set (section 3.1.4.10.1) when
@ParentListDeletedUrls is set to 1 and if the deletion of the parent item of the cascading delete operation finished successfully.
3.1.4.10.1 Deleted Documents Result Set
The Deleted Document Result Set MUST be returned only for the parent item of the cascading delete operation when @ParentListDeletedUrls is set to 1 and the deletion of the parent item finished successfully. For more information, see [MS-WSSFO2] section 3.1.5.13.1.