2.2.6.1 AllDocs Table
The AllDocs table stores data for all documents in the content database.
The AllDocs table is defined using T-SQL syntax as follows.
-
TABLE AllDocs( Id uniqueidentifier NOT NULL, SiteId uniqueidentifier NOT NULL, DirName nvarchar(256) NOT NULL, LeafName nvarchar(128) NOT NULL, WebId uniqueidentifier NOT NULL, ListId uniqueidentifier NULL, DoclibRowId int NULL, Type tinyint NOT NULL, SortBehavior tinyint NOT NULL DEFAULT 0, Size int NULL, ETagVersion AS CASE WHEN InternalVersion IS NULL THEN NULL ELSE ((InternalVersion + (BumpVersion * 256)) / 256) END, EffectiveVersion AS CASE WHEN InternalVersion IS NULL THEN NULL ELSE InternalVersion + (BumpVersion * 256) END, InternalVersion int NULL, BumpVersion tinyint NOT NULL DEFAULT 0, UIVersion int NOT NULL DEFAULT 512, Dirty AS CASE WHEN BumpVersion <> 0 THEN CAST(1 as bit) ELSE CAST(0 as bit) END, ListDataDirty bit NOT NULL DEFAULT 0, DocFlags int NULL, ThicketFlag bit NULL DEFAULT 0, CharSet int NULL, ProgId nvarchar(255) NULL, TimeCreated datetime NOT NULL, TimeLastModified datetime NOT NULL, NextToLastTimeModified datetime NULL, MetaInfoTimeLastModified datetime NULL, TimeLastWritten datetime NULL, DeleteTransactionId varbinary(16) NOT NULL DEFAULT 0x, SetupPathVersion tinyint NOT NULL DEFAULT 4, SetupPath nvarchar(255) NULL, SetupPathUser nvarchar(255) NULL, CheckoutUserId int NULL, CheckoutDate datetime NULL, CheckoutExpires datetime NULL, VersionCreatedSinceSTCheckout bit NOT NULL DEFAULT 0, LTCheckoutUserId AS CASE WHEN DocFlags & 32 = 32 THEN CheckoutUserId ELSE NULL END, VirusVendorID int NULL, VirusStatus int NULL, VirusInfo nvarchar(255) NULL, VirusInfoEx, varbinary(max) NULL, MetaInfo varbinary(max) NULL, MetaInfoSize int NULL, MetaInfoVersion int NOT NULL DEFAULT 1, UnVersionedMetaInfo varbinary(max) NULL, UnVersionedMetaInfoSize int NULL, UnVersionedMetaInfoVersion int NULL, WelcomePageUrl nvarchar(260) NULL, WelcomePageParameters nvarchar(max) NULL, IsCurrentVersion bit NOT NULL DEFAULT 1, Level tinyint NOT NULL DEFAULT 1, CheckinComment nvarchar(1023) NULL, AuditFlags int NULL, InheritAuditFlags int NULL, DraftOwnerId int NULL, UIVersionString AS CAST(UIVersion/512 AS nvarchar) + '.' + CAST(UIVersion%512 AS nvarchar), ParentId uniqueidentifier NOT NULL, HasStream AS WHEN Type = 0 AND ((DocFlags & 256) = 256) AND SetupPath IS NULL OR (SetupPath IS NOT NULL AND ((DocFlags & 64) = 64)) THEN 1 ELSE 0 END, ScopeId uniqueidentifier NOT NULL, BuildDependencySet varbinary(max) NULL, ParentVersion int NULL, ParentVersionString AS CAST(ParentVersion/512 AS nvarchar) + '.' + CAST(ParentVersion%512 AS nvarchar), TransformerId uniqueidentifier NULL, ParentLeafName nvarchar(128) NULL, IsCheckoutToLocal AS CASE WHEN DocFlags & 512 = 512 THEN 1 ELSE 0 END, CtoOffset smallint NULL, Extension AS CASE WHEN CHARINDEX(N'.', LeafName COLLATE Latin1_General_BIN) > 0 THEN RIGHT(LeafName, CHARINDEX(N'.', REVERSE(LeafName) COLLATE Latin1_General_BIN)-1) ELSE N'' END, ExtensionForFile AS CASE WHEN Type = 0 AND CHARINDEX(N'.', LeafName COLLATE Latin1_General_BIN) > 0 THEN RIGHT(LeafName, CHARINDEX(N'.', REVERSE(LeafName) COLLATE Latin1_General_BIN)-1) ELSE N'' END, ItemChildCount int NOT NULL DEFAULT 0, FolderChildCount int NOT NULL DEFAULT 0, FileFormatMetaInfo varbinary(max) NULL, FileFormatMetaInfoSize int NOT NULL DEFAULT 0, FFMConsistent bit NULL, ContentVersion int NOT NULL DEFAULT 0, ListSchemaVersion int NULL, ClientId varbinary(16) NULL, NextBSN bigint NULL, StreamSchema tinyint NULL);
Id: The document identifier of the document.
SiteId: The Site Collection Identifier (section 2.2.1.1.9) of the site collection containing the document.
DirName: The directory name of the document location.
LeafName: The leaf name of the document location.
WebId: The Site Identifier (section 2.2.1.1.11) of the site containing the document.
ListId: The List Identifier (section 2.2.1.1.5) of the list containing the document, if any, or NULL if the document is not contained in a list.
DoclibRowId: The row identifier for the document within the containing document library or list, if applicable.
Type: An integer identifier specifying the document's Document Store Type (section 2.2.2.4).
SortBehavior: An integer value specifying how an item is sorted within a view. If this parameter is set to 1, the item MUST be sorted like a folder. If this parameter is set to 0, it MUST be sorted like a file. If the document is a site (2), the value MUST be 2. Other values are invalid.
Size: The size of the document stream in bytes. This parameter can be set to NULL or to zero for items such as sites, folders, document libraries, and lists.
ETagVersion: A counter used for conflict detection that is incremented any time a change is made to this document. This takes into account the pending version update in BumpVersion. This is a version number separate from the user-visible versioning system in UIVersion and UIVersionString.
EffectiveVersion: A counter incremented any time a change is made to the document and is only used internally. This takes into account the pending version update in BumpVersion.
InternalVersion: A counter incremented any time a change is made to the document and is only used internally to join to other tables. This does not take into account the pending version update in BumpVersion.
BumpVersion: A counter incremented any time the InternalVersion of a document needs to be updated. It stores the pending version update to the document.
UIVersion: A UI version number associated with the document. UIVersion defaults to 512, which corresponds to a displayed version of 1.0.
Dirty: Set to one if the document has dependencies that require further processing.
ListDataDirty: Set to one if the document requires subsequent fix-up of link information.
CacheParseId: An implementation-specific identifier for an internal dependency update process. Used to manage bulk updates to documents when processed for dependency fix-up.
DocFlags: A Doc Flags value (section 2.2.2.3) specifying information about the document. See the Doc Flags section for details.
ThicketFlag: If set to one, this indicates that the document is an auxiliary thicket file, one of a set of files supporting a thicket.
CharSet: An optional character set associated with the document. Any Windows code page identifier is valid for CharSet. This value can be NULL, indicating that no Windows code page is specified for the document.
ProgId: An optional preferred application to open this document. The ProgId is used to distinguish between different applications that save files with a given file extension (that is, different editors for HTML or XML files).
TimeCreated: A time stamp in UTC format specifying when this document was created.
TimeLastModified: A time stamp in UTC format. The value specifies when the document was last saved. This corresponds to the actual time when the document was last modified.
NextToLastTimeModified: The value of TimeLastModified from the previous time that the document was saved.
MetaInfoTimeLastModified: A time stamp in UTC format specifying when the metadata information for the document was last changed.
TimeLastWritten: A time stamp in UTC format specifying when any changes were made to the document stream. This does not reflect changes made strictly to the MetaInfo or other item properties.
DeleteTransactionId: The transaction identifier for the implementation-specific deleted items recycle bin. A value of 0x specifies that this document is not marked as deleted. In the Docs View (section 2.2.6.3), DeleteTransactionId MUST equal 0x, because the Docs View only displays items that are not marked as deleted.
SetupPathVersion: For an uncustomized document, this parameter governs the SetupPath fragment relative to the setup path location. The following values are valid.
Value |
Description |
---|---|
NULL |
This is not an uncustomized document. |
2 |
The SetupPath is relative to the install location of Windows SharePoint Services 2.0 on the front-end Web server (for example, Program Files\Common Files\Microsoft Shared\Web Server Extensions\60). |
3 |
The SetupPath is relative to the install location of Windows SharePoint Services 3.0 on the front-end Web server (for example, Program Files\Common Files\Microsoft Shared\Web Server Extensions\12). |
4 |
The SetupPath is relative to the install location of Microsoft SharePoint Foundation 2010 on the front-end Web server (for example, Program Files\Common Files\Microsoft Shared\Web Server Extensions\14). |
15 |
The SetupPath is relative to the install location of Microsoft SharePoint Foundation 2013 on the front-end Web server (for example, Program Files\Common Files\Microsoft Shared\Web Server Extensions\15). |
16 |
The SetupPath is relative to the install location of Microsoft SharePoint Server 2016 on the front-end Web server (for example, Program Files\Common Files\Microsoft Shared\Web Server Extensions\16). |
SetupPath: For a document that is now or once was uncustomized, this contains the setup path fragment relative to the base setup path specified by the SetupPathVersion value, where the content stream of this document can be found. This value MUST be NULL if the document was never uncustomized.
SetupPathUser: If this document is now or once was uncustomized, this contains the login name of the user who created the uncustomized document. This value is undefined for documents that were never uncustomized.
CheckoutUserId: If the document is checked out, this parameter contains the User Identifier (section 2.2.1.1.13) of the user who has the document checked out. Otherwise, this parameter is NULL.
CheckoutDate: A time stamp in UTC format indicating when this document was checked out.
CheckoutExpires: A time stamp in UTC format indicating when the short-term lock for this document will expire.
VersionCreatedSinceSTCheckout: If this parameter is one, the document version has been incremented since the document last had a short-term lock established. This is used to prevent more than one new version of the document from being created while a short-term lock is established.
LTCheckoutUserId: If the document is currently checked out, this parameter is a calculated column containing the value of CheckoutUserId. Otherwise, this parameter is NULL.
VirusVendorID: The identifier of the virus scanner that processed this document. This value MUST be NULL if this document has not been processed by a virus scanner.
VirusStatus: An enumerated type specifying the current virus check status of this document. This value MUST be NULL if the document has not been processed by a virus scanner. See Virus Status (section 2.2.1.2.17) for a list of valid values.
VirusInfo: A string containing a provider-specific message returned by the virus scanner when it last processed the document. This value MUST be NULL if the document has not been processed by a virus scanner.
VirusInfoEx: A binary value that specifies extensible virus information for this document, which is opaque to the back-end server.
MetaInfo: A metadict for the document. The metadict format is specified in the [MS-FPSE] section 2.2.2.2.11.
MetaInfoSize: The size, in bytes, of the document metadata info.
MetaInfoVersion: An integer value that tracks the version of the document metadata info.
UnVersionedMetaInfo: A metadict holding all version-independent metadata for the document.
UnVersionedMetaInfoSize: The size in bytes of UnVersionedMetaInfo.
UnVersionedMetaInfoVersion: An integer value that tracks the version of the UnVersionedMetaInfo metadata.
WelcomePageUrl: If the document is a folder, this optionally specifies a page to redirect to when the folder is requested with an HTTP GET operation. The URL is relative to the URL of the folder itself and MUST be subsumed by that folder. Attempts to break out of the folder, such as "../../default.aspx", are not valid.
WelcomePageParameters: This parameter MUST contain any URL parameters configured for the welcome page. This value contains a query string starting with "?" or a hash parameter starting with "#".
IsCurrentVersion: If this value is set to one, this row is for a current version of the document (out of all the rows corresponding to the given DirName, LeafName, each with a different Publishing Level Type value (section 2.2.2.6)). Otherwise, this row is for a historical version of the document.
Level: A Publishing Level Type value specifying the publishing level of this version of the document as checked out, draft, or published.
CheckinComment: An optional comment string associated with the document when it was last checked in or published.
AuditFlags: An Audit Flags value (section 2.2.2.1) determining the operations to be tracked on this document.
InheritAuditFlags: An Audit Flags value determining the operations to be tracked on this document's children.
DraftOwnerId: If the current publishing level of the document is a draft, this is the User Identifier (section 2.2.1.1.13) of the user who has that draft version checked out. Otherwise, this MUST be set to NULL.
UIVersionString: A calculated column presenting the value of the UIVersion column as a displayed version string, in the following format: major version value, followed by '.', followed by the minor version value. For example, UIVersion values 512, 513, 514, and 1024 correspond to UIVersionString values of 1.0, 1.1, 1.2, and 2.0, respectively.
ParentId: The document identifier of the document's parent container. For example, the document identifier of the folder or document library containing this subfolder or document. This value MUST NOT be NULL, because every item but one has a parent container. A special empty document identifier, '00000000-0000-0000-0000-000000000000', marks the parent container of the topmost item (the root site) in the site collection.
HasStream: A calculated bit indicating whether the document has an associated document stream. This MUST be set to "1" if:
The SetupPath is NULL and the document's Document Store Type is zero (file) and it is allowed to contain a stream.
The SetupPath is not NULL and the document content is customized.
If neither condition applies, the value MUST be "0".
ScopeId: The Scope Identifier (section 2.2.1.1.8) of the scope of the document.
BuildDependencySet: A binary array holding implementation-specific information about dependent documents. NULL indicates that there is no information about dependencies. A BuildDependencySet of size zero indicates a document with no dependencies.
ParentVersion: If the document is a transformed version of another document, this is the UIVersion value from the original document. This value MUST be NULL if the document is not the product of a document transformation.
ParentVersionString: A calculated column presenting the value of the ParentVersion column as a displayed version string. See UIVersionString for displayed version format and examples.
TransformerId: If the document is a transformed version of another document, this MUST be the GUID of the agent that performed the transformation. Otherwise, TransformerId MUST be NULL.
ParentLeafName: If the document is a transformed version of another document and the original document is in the same folder as the transformed document, this is the leaf name of the original document. This value MUST be NULL if the document is not the product of a document transformation.
IsCheckoutToLocal: A calculated bit indicating whether the document is checked out to a client's local disk. This parameter MUST be set to "1" if the DocFlags bit array includes 512 (long-term check-out to local); otherwise, it MUST be set to "0".
CtoOffset: A content type order offset. This is an implementation-specific value used by list and document library views to allow custom ordering of the menu items under the 'New' button. This value can be NULL.
Extension: A calculated field holding the file extension part, if applicable, from the LeafName value. If the LeafName value contains a "." character, Extension MUST hold the string following the last "."; otherwise, Extension MUST be set to the empty string. For example, if the full leaf name is 'document.docx.bac', Extension MUST be "bac".
ExtensionForFile: A calculated field holding the file extension part, if applicable, from the LeafName value. If the document's Document Store Type is set to "0", indicating that it is a file type, ExtensionForFile MUST be identical to Extension; otherwise, the ExtensionForFile value MUST be an empty string.
ItemChildCount: The number of nonfolder children of this document.
FolderChildCount: The number of folder children of this document.
FileFormatMetaInfo: A metadict holding the file format metadata info of this document.
FileFormatMetaInfoSize: The size, in bytes, of the file format metadata info.
FFMConsistent: A bit flag specifying whether the file format metadata info is in a consistent state.
ContentVersion: A counter used for internal conflict detection that is incremented any time a change is made to the binary contents of this document.
ListSchemaVersion: A counter which keeps track of the schema version of the list containing this document for a document that can be parsed.
ClientId: An identifier assigned by an external client to keep track of this document.
NextBSN: The current BLOB sequence number for the document, used for assigning BLOB sequence numbers to stream binary pieces belonging to this document.
StreamSchema: The stream schema of the stream belonging to this document, if it has one indicated by HasStream.