2.2.7.1 AllDocs Table

The AllDocs Table stores data for all documents in the SharePoint Store. 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,
 Size                           int               NULL,
 MetaInfoSize                   int               NULL,
 Version                        int               NULL,
 UIVersion                      int               NOT NULL DEFAULT 512,
 Dirty                          bit               NULL,
 ListDataDirty                  bit               NOT NULL DEFAULT 0,
 CacheParseId                   uniqueidentifier  NULL,
 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 3,
 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  end),
 VirusVendorID                  int               NULL,
 VirusStatus                    int               NULL,
 VirusInfo                      nvarchar(255)     NULL,
 MetaInfo                       image             NULL,
 UnVersionedMetaInfo            image             NULL,
 UnVersionedMetaInfoSize        int               NULL,
 UnVersionedMetaInfoVersion     int               NULL,
 WelcomePageUrl                 nvarchar(260)     NULL,
 WelcomePageParameters          ntext             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                ((CONVERT(nvarchar,UIVersion
                                                            /(512),0)+'.')
                                                  +CONVERT(nvarchar,
                                                          UIVersion%(512),0)),
 ParentId                       uniqueidentifier  NOT NULL,
 HasStream                      AS                (case 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             image             NULL,
 ParentVersion                  int               NULL,
 ParentVersionString            AS                ((CONVERT(nvarchar,ParentVersion/
                                                            (512),0)+'.')
                                                  +CONVERT(nvarchar,ParentVersion%
                                                            (512),0)),
 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,
 );

Id: The document identifier (section 2.2.1.2) of the document.

SiteId: The Site Collection Identifier (section 2.2.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.11) of the site containing the document.

ListId: The List Identifier (section 2.2.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).

Size: The size of the document stream in bytes. This parameter can be set to NULL or to 0 for items such as sites, folders, document libraries, and lists.

MetaInfoSize: The size, in bytes, of the document metadata info.

Version: A counter incremented any time a change is made to this document and used for internal conflict detection. This is an internal document version separate from the user-visible versioning system reflected in UIVersion and UIVersionString.

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 1 if the document has dependencies that require further processing.

ListDataDirty: Set to 1 if the document requires subsequent fix-up of link information.

CacheParseId: A SharePoint 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 (section 2.2.2.3) value specifying information about the document. See the Doc Flags section for details.

ThicketFlag: If set to 1, 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.7.4), DeleteTransactionId MUST equal 0x, because the Docs View only displays items that are not marked as deleted.

SetupPathVersion: For a ghosted document, this parameter governs the SetupPath fragment relative to the setup path location. The following values are valid.

Value

Description

NULL

This is NOT a ghosted document.

2

The SetupPath is relative to the install location of Windows SharePoint Services 2.0 on the WFE (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 WFE (for example, Program Files\Common Files\Microsoft Shared\Web Server Extensions\12).

SetupPath: For a document that is now or once was ghosted, 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 ghosted.

SetupPathUser: If this document is now or once was ghosted, this contains the login name of the user who created the ghosted document. This value is undefined for documents that were never ghosted.

CheckoutUserId: If the document is checked out, this parameter contains the User Identifier (section 2.2.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 1, 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.3.18) in the Flags section 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.

MetaInfo: A metadict for the document. The metadict format is specified in the [MS-FPSE] metadict section.

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 1, 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 (section 2.2.2.6) value). 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 (section 2.2.2.1) value 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 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 0 (file) and it is allowed to contain a stream.

  • The SetupPath is not NULL and the document content is UnGhosted.

If neither condition applies, the value MUST be "0".

ScopeId: The Scope Identifier (section 2.2.1.8) of the scope of the document.

BuildDependencySet: A binary image holding implementation-specific information about dependent documents. NULL indicates that there is no information about dependencies. A BuildDependencySet of size 0 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, this is the leaf name of the original document. The original document MUST be in the same folder as the transformed 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 a SharePoint 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 (2) 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 (2) 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, 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.