3.1.5.131 proc_UpdateListItem
The proc_UpdateListItem stored procedure is invoked to update a list item in a document library or list.
-
PROCEDURE proc_UpdateListItem( @SiteId uniqueidentifier, @WebId uniqueidentifier, @ListId uniqueidentifier, @ItemId int, @RowOrdinal int, @Size int, @ExtraItemSize int = NULL, @ItemName nvarchar(255) = NULL, @UseNvarchar1ItemName bit = 1, @ItemDirName nvarchar(256) = NULL OUTPUT, @ItemLeafName nvarchar(256) = NULL OUTPUT, @UserId int, @Level tinyint = 1 OUTPUT, @TimeNow datetime, @NeedsAuthorRestriction bit = 0, @NeedsDraftOwnerRestriction bit = 0, @PreserveVersion bit = 0, @IsMeetingsList bit = NULL, @IsIssueList bit = NULL, @IsNotUserDisplayed bit = NULL, @SystemUpdate bit = 0, @ChangeLevel bit = 0, @CheckinItem bit = 0, @NeedClone bit = 0, @MajorVersionsLimit int = 0, @MajorMinorVersionsLimit int = 0, @IsDocLib bit = 0, @CheckSchemaVersion int = NULL, @SortTypeReversed bit = NULL, @tp_Ordering varchar(512) = NULL, @tp_ThreadIndex varbinary(512) = NULL, @tp_HasAttachment bit = NULL, @tp_ModerationStatus int = NULL, @tp_IsCurrent bit = NULL, @tp_ItemOrder float = NULL, @tp_Version int = NULL, @tp_InstanceID int = NULL, @tp_ContentTypeId tContentTypeId = NULL, @tp_CopySource nvarchar(260) = NULL, @tp_HasCopyDestinations bit = NULL, @OnRestore bit = 0, @BumpLastDelete bit = NULL, @CreateItemVersion bit = 0, @UIVersion int = NULL, @NewUIVersion int = NULL OUTPUT, @ReturnRowset bit = 1, @tp_Author int = NULL, @tp_Editor int = NULL, @tp_Created datetime = NULL, @tp_Modified datetime = NULL, @tp_WorkflowVersion int = NULL, @nvarchar1 nvarchar(255) = NULL, @nvarchar2 nvarchar(255) = NULL, @nvarchar3 nvarchar(255) = NULL, @nvarchar4 nvarchar(255) = NULL, @nvarchar5 nvarchar(255) = NULL, @nvarchar6 nvarchar(255) = NULL, @nvarchar7 nvarchar(255) = NULL, @nvarchar8 nvarchar(255) = NULL, @nvarchar9 nvarchar(255) = NULL, @nvarchar10 nvarchar(255) = NULL, @nvarchar11 nvarchar(255) = NULL, @nvarchar12 nvarchar(255) = NULL, @nvarchar13 nvarchar(255) = NULL, @nvarchar14 nvarchar(255) = NULL, @nvarchar15 nvarchar(255) = NULL, @nvarchar16 nvarchar(255) = NULL, @nvarchar17 nvarchar(255) = NULL, @nvarchar18 nvarchar(255) = NULL, @nvarchar19 nvarchar(255) = NULL, @nvarchar20 nvarchar(255) = NULL, @nvarchar21 nvarchar(255) = NULL, @nvarchar22 nvarchar(255) = NULL, @nvarchar23 nvarchar(255) = NULL, @nvarchar24 nvarchar(255) = NULL, @nvarchar25 nvarchar(255) = NULL, @nvarchar26 nvarchar(255) = NULL, @nvarchar27 nvarchar(255) = NULL, @nvarchar28 nvarchar(255) = NULL, @nvarchar29 nvarchar(255) = NULL, @nvarchar30 nvarchar(255) = NULL, @nvarchar31 nvarchar(255) = NULL, @nvarchar32 nvarchar(255) = NULL, @nvarchar33 nvarchar(255) = NULL, @nvarchar34 nvarchar(255) = NULL, @nvarchar35 nvarchar(255) = NULL, @nvarchar36 nvarchar(255) = NULL, @nvarchar37 nvarchar(255) = NULL, @nvarchar38 nvarchar(255) = NULL, @nvarchar39 nvarchar(255) = NULL, @nvarchar40 nvarchar(255) = NULL, @nvarchar41 nvarchar(255) = NULL, @nvarchar42 nvarchar(255) = NULL, @nvarchar43 nvarchar(255) = NULL, @nvarchar44 nvarchar(255) = NULL, @nvarchar45 nvarchar(255) = NULL, @nvarchar46 nvarchar(255) = NULL, @nvarchar47 nvarchar(255) = NULL, @nvarchar48 nvarchar(255) = NULL, @nvarchar49 nvarchar(255) = NULL, @nvarchar50 nvarchar(255) = NULL, @nvarchar51 nvarchar(255) = NULL, @nvarchar52 nvarchar(255) = NULL, @nvarchar53 nvarchar(255) = NULL, @nvarchar54 nvarchar(255) = NULL, @nvarchar55 nvarchar(255) = NULL, @nvarchar56 nvarchar(255) = NULL, @nvarchar57 nvarchar(255) = NULL, @nvarchar58 nvarchar(255) = NULL, @nvarchar59 nvarchar(255) = NULL, @nvarchar60 nvarchar(255) = NULL, @nvarchar61 nvarchar(255) = NULL, @nvarchar62 nvarchar(255) = NULL, @nvarchar63 nvarchar(255) = NULL, @nvarchar64 nvarchar(255) = NULL, @int1 int = NULL, @int2 int = NULL, @int3 int = NULL, @int4 int = NULL, @int5 int = NULL, @int6 int = NULL, @int7 int = NULL, @int8 int = NULL, @int9 int = NULL, @int10 int = NULL, @int11 int = NULL, @int12 int = NULL, @int13 int = NULL, @int14 int = NULL, @int15 int = NULL, @int16 int = NULL, @float1 float = NULL, @float2 float = NULL, @float3 float = NULL, @float4 float = NULL, @float5 float = NULL, @float6 float = NULL, @float7 float = NULL, @float8 float = NULL, @float9 float = NULL, @float10 float = NULL, @float11 float = NULL, @float12 float = NULL, @datetime1 datetime = NULL, @datetime2 datetime = NULL, @datetime3 datetime = NULL, @datetime4 datetime = NULL, @datetime5 datetime = NULL, @datetime6 datetime = NULL, @datetime7 datetime = NULL, @datetime8 datetime = NULL, @bit1 bit = NULL, @bit2 bit = NULL, @bit3 bit = NULL, @bit4 bit = NULL, @bit5 bit = NULL, @bit6 bit = NULL, @bit7 bit = NULL, @bit8 bit = NULL, @bit9 bit = NULL, @bit10 bit = NULL, @bit11 bit = NULL, @bit12 bit = NULL, @bit13 bit = NULL, @bit14 bit = NULL, @bit15 bit = NULL, @bit16 bit = NULL, @uniqueidentifier1 uniqueidentifier = NULL, @ntext1 nvarchar(max) = NULL, @ntext2 nvarchar(max) = NULL, @ntext3 nvarchar(max) = NULL, @ntext4 nvarchar(max) = NULL, @ntext5 nvarchar(max) = NULL, @ntext6 nvarchar(max) = NULL, @ntext7 nvarchar(max) = NULL, @ntext8 nvarchar(max) = NULL, @ntext9 nvarchar(max) = NULL, @ntext10 nvarchar(max) = NULL, @ntext11 nvarchar(max) = NULL, @ntext12 nvarchar(max) = NULL, @ntext13 nvarchar(max) = NULL, @ntext14 nvarchar(max) = NULL, @ntext15 nvarchar(max) = NULL, @ntext16 nvarchar(max) = NULL, @ntext17 nvarchar(max) = NULL, @ntext18 nvarchar(max) = NULL, @ntext19 nvarchar(max) = NULL, @ntext20 nvarchar(max) = NULL, @ntext21 nvarchar(max) = NULL, @ntext22 nvarchar(max) = NULL, @ntext23 nvarchar(max) = NULL, @ntext24 nvarchar(max) = NULL, @ntext25 nvarchar(max) = NULL, @ntext26 nvarchar(max) = NULL, @ntext27 nvarchar(max) = NULL, @ntext28 nvarchar(max) = NULL, @ntext29 nvarchar(max) = NULL, @ntext30 nvarchar(max) = NULL, @ntext31 nvarchar(max) = NULL, @ntext32 nvarchar(max) = NULL, @sql_variant1 sql_variant = NULL, @error_sql_variant1 int = 0, @sql_variant2 sql_variant = NULL, @error_sql_variant2 int = 0, @sql_variant3 sql_variant = NULL, @error_sql_variant3 int = 0, @sql_variant4 sql_variant = NULL, @error_sql_variant4 int = 0, @sql_variant5 sql_variant = NULL, @error_sql_variant5 int = 0, @sql_variant6 sql_variant = NULL, @error_sql_variant6 int = 0, @sql_variant7 sql_variant = NULL, @error_sql_variant7 int = 0, @sql_variant8 sql_variant = NULL, @error_sql_variant8 int = 0, @eventData varbinary(max) = NULL, @acl varbinary(max) = NULL, @IsFirstRow bit = 1, @RequestGuid uniqueidentifier = NULL OUTPUT );
@SiteId: The site collection identifier (section 2.2.1.9) for the site collection containing the list item to be updated.
@WebId: The site identifier (section 2.2.1.11) for the site containing the list item.
@ListId: The list identifier (section 2.2.1.5) of the List containing the list item.
@ItemId: The item identifier of the list item.
@RowOrdinal: The 0-based ordinal of the row to update in the set of rows representing this list item in the AllUserData table (section 2.2.7.3). If a list item requires multiple rows to represent it in the AllUserData table because it contains more defined data columns than will fit in a single row, then this parameter specifies which row to update with this call. If more than one row of data for the list item is to be updated, then the front-end web server MUST call proc_UpdateListItem once for each updated row. This parameter MUST NOT be NULL.
@Size: The new size, in bytes, of the list item row to be updated. This parameter MUST NOT be NULL.
@ExtraItemSize: The size, in bytes, of the predefined SQL parameter fields in the list item row.
@ItemName: The new display name for the list item.
@UseNvarchar1ItemName: If @ItemName is NULL, then this bit flag specifies use of the content of @nvarchar1 for the new display name for the list item. If @ItemName is not NULL, then this parameter MUST be ignored.
@ItemDirName: An output parameter containing the directory name of the updated list item.
@ItemLeafName: An output parameter containing the leaf name of the updated list item.
@UserId: The user identifier (section 2.2.1.13) for the current user. This parameter is used for comparison when the @NeedsAuthorRestriction or @NeedsDraftOwnerRestriction parameters are set. If this parameter is NULL, then the user identifier stored as the list item's editor MUST be used as the current user.
@Level: A Publishing Level type (section 2.2.2.6) value specifying the publishing status of the updated list item.
@TimeNow: The current datetime in UTC. This parameter MUST NOT be NULL.
@NeedsAuthorRestriction: A bit flag specifying whether or not only the list item's author is permitted to update the list item. If this parameter is set to 1, then the current user MUST be the list item's author.
@NeedsDraftOwnerRestriction: A bit flag specifying whether or not only the list item's draft owner is permitted to update the list item. If this parameter is set to 1, the current user MUST be the list item's draft owner.
@PreserveVersion: A bit flag specifying whether to preserve the internal version number of the list item to be updated. If this parameter is set to 1, then the internal version number of the list item MUST NOT be incremented as part of the update. Otherwise, if the list item is updated, then the current internal version number MUST be incremented by an implementation-specific amount.
@IsMeetingsList: A bit flag specifying whether the list item is contained in a Meetings List (a List with a List Server Template (section 2.2.3.12) value of 200).
@IsIssueList: A bit flag specifying whether the list item is contained in an Issues List (a List with a List Server Template value of 1100). This parameter MUST be ignored.
@IsNotUserDisplayed: A bit flag specifying whether the display name of the current user is not to be displayed in logging events for this update. If this parameter is set to 1, then the display name of the current user MUST NOT be used when proc_UpdateListItem logs events due to the update, and the string "***" MUST be used instead.
@SystemUpdate: A bit flag specifying whether to leave the last modification time stamp and the list item editor unchanged during this update. If this parameter is set to 1, then the list item MUST be updated without affecting the current last modification time or list item editor.
@ChangeLevel: A bit flag specifying whether to recalculate the publishing level of the list item as part of the update. If this parameter is set to 1, then the list item's publishing level MUST be recalculated.
@CheckinItem: A bit flag specifying whether to set the publishing level for the updated list item to published. If this parameter is set to 1, then proc_UpdateListItem MUST set the updated List Item's publishing level to 1 (published).
@NeedClone: A bit flag specifying whether a copy of the list item as a draft version is made as part of this update. If this parameter is set to 1, then the publishing level specified by the @Level parameter MUST also be set to 1 (published).
@MajorVersionsLimit: The number of major versions to keep of the list item.
@MajorMinorVersionsLimit: The total combined number of major versions and minor versions to keep of the list item.
@IsDocLib: A bit flag specifying whether the list item to be updated is contained within a document library. If this parameter is set to 1, then the List specified by @ListId MUST be a document library.
@CheckSchemaVersion: This specifies a list schema version number to compare with the list schema version of the list item's containing List. If this parameter is not NULL and does not match the current list schema version number, then the list item MUST NOT be updated.
@SortTypeReversed: If this parameter is 1, then the sort behavior for this item MUST be changed to the opposite of the value of the list item's type. If this parameter is 0 or NULL, then the sort behavior for this item MUST NOT be changed.
@tp_Ordering: This specifies the threading structure for this list item in a legacy Discussion Board List (a list with a List Base type (section 2.2.3.11) of 3) as a concatenation of timestamp values in yyyyMMddHHmmss format. For all list items in lists with other List Base types, this parameter MUST be NULL.
@tp_ThreadIndex: This specifies the list item's position within a threaded legacy Discussion Board List (a List with a List Base type of 3) as a binary structure. For all List Items in Lists with other List Base types, this parameter MUST be NULL.
@tp_HasAttachment: A bit flag specifying whether the list item has an associated attachment.
@tp_ModerationStatus: A Moderation Status (section 2.2.3.13) value specifying the current moderation approval status of this list item.
@tp_IsCurrent: A bit flag specifying whether this is the current version of this publishing level of the list item.
@tp_ItemOrder: This specifies the implementation-specific order in which the list item SHOULD be displayed with other list items from the same list. This value can be the same as other list items in the list.
@tp_Version: The internal version number value of the list item to update. If this parameter is not NULL and does not equal the current value of the internal version number of the list item, then the item MUST NOT be updated.
@tp_InstanceID: This parameter MUST be ignored.
@tp_ContentTypeId: This specifies the content type identifier of the content type for this list item. tContentTypeId is defined in section 2.2.1.1.
@tp_CopySource: The URL used as a source for this list item. If this list item was not copied from a source list item, then this value MUST be NULL.
@tp_HasCopyDestinations: A bit flag specifying whether destination locations have been set for this list item to be copied to. If this list item does not have a destination location set, then this value MUST be 0.
@OnRestore: A bit flag specifying whether this list item is being inserted by an implementation-specific backup restore operation.
@BumpLastDelete: A bit flag specifying whether to update the tp_LastDeleted (section 2.2.5.12) property on the List specified by @ListId. If set to 0, then the tp_ LastDeleted property MUST NOT be updated.
@CreateItemVersion: A bit flag specifying whether to create a new version of the list item as part of this update.
@UIVersion: The UI version number to set for the list item.
@NewUIVersion: An output parameter returning the UI version number set for the list item, which MUST be NULL if one was not assigned.
@ReturnRowset: A bit flag specifying whether to return an Item Update Result Set (section 3.1.5.131.1).
@tp_Author: The user identifier to set as the author of the list item.
@tp_Editor: The user identifier to set as the last editor of the list item.
@tp_Created: A datetime in UTC to set as the list item's creation time stamp. If this parameter is NULL or @SystemUpdate is "1", then the current time stamp MUST NOT be updated.
@tp_Modified: A datetime in UTC to set as the list item's last modified time stamp. If this parameter is NULL or @SystemUpdate is "1", then the current time stamp MUST NOT be updated. If this parameter is NULL and @SystemUpdate is not "1", then @TimeNow SHOULD be set as the list item's last modified time stamp.
@tp_WorkflowVersion: If this list item is part of a workflow, then this specifies the value to set denoting the state of this list item within that workflow. If this list item is not part of a workflow, then this value MUST be NULL.
The next nine columns are duplicated a variable number of times, depending on the List Item's content type and field definitions, with each column referring to a separate List Server Template-defined field or user-defined field within the containing List. Each instance of these individual column names is differentiated by a suffix with a numeric value indicated in the column description, which replaces the placeholder "#" symbol below.
@nvarchar#: User-defined columns in the List containing values of type nvarchar. There are 64 columns numbered from 1 to 64. If the column does not contain data, then the value MUST be NULL.
@int#: User-defined columns in the List containing values of type int. There are 16 columns numbered from 1 to 16. If the column does not contain data, then the value MUST be NULL.
@float#: User-defined columns in the List containing values of type float. There are 12 columns numbered from 1 to 12. If the column does not contain data, then the value MUST be NULL.
@datetime#: User-defined columns in the List containing values of type datetime. There are eight columns numbered from 1 to 8. If the column does not contain data, then the value MUST be NULL.
@bit#: User-defined columns in the List containing values of type bit. There are 16 columns numbered from 1 to 16. If the column does not contain data, then the value MUST be NULL.
@uniqueidentifier1: A user-defined column in the List containing values of type uniqueidentifier. If the column does not contain data, then the value MUST be NULL.
@ntext#: User-defined columns in the List containing values of type nvarchar(max). There are 32 columns numbered from 1 to 32. If the column does not contain data, then the value MUST be NULL.
@sql_variant#: User-defined columns in the List containing values of type sql_variant. There are 8 columns numbered from 1 to 8. If the column does not contain data, then the value MUST be NULL.
@error_sql_variant#: An integer which specifies the type to be applied to the corresponding values specified as arguments for the parameter @sql_variant#. There are 8 columns numbered from 1 to 8. The following are valid values.
Value |
Description |
---|---|
1 |
Convert the argument value to a varbinary(2). |
2 |
Convert the argument value to a bit. |
3 |
Convert the argument value to a float. |
4 |
Convert the argument value to a datetime. |
@eventData: Contains implementation-specific event (2) 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 a log file.
@acl: The binary serialization of the WSS ACL Format (section 2.2.4.6) access control list for the data supplied in @eventData, to be stored with the data.
@IsFirstRow: If @RowOrdinal is 0, then this parameter MUST be 1. Otherwise this parameter MUST be 0.
@RequestGuid: The optional request identifier for the current request.
Return Values: The proc_UpdateListItem stored procedure returns an integer return code, which MUST be in the following table.
Value |
Description |
---|---|
0 |
Successful execution. |
3 |
Could not create a unique filename, or the specified site does not exist. |
5 |
The current user does not have sufficient permissions to update the list item. |
13 |
The list item to be added is not valid. |
87 |
Unable to update the list item because the input parameters do not match an existing list item, or an error occurred during a table update operation. |
160 |
A valid user identifier was not specified. |
212 |
The database for the site is locked. |
288 |
The list item cannot be published by the current user because a different user is listed as the draft owner. |
1150 |
Failed to update the list item. |
1638 |
The current schema version of the list does not match the value specified in @CheckSchemaVersion. |
1639 |
Only a published list item can be copied. |
1816 |
The site collection is over its allocated size quota. |
4005 |
The specified list item was not found. |
The proc_UpdateListItem stored procedure MUST return zero or one result sets as follows.