Alec Tang

Professional Web Developer/ Web Designer

I build websites based on the latest web standards providing the best possible solution to your company

  • Home
  • About
  • Portfolio
  • Contact
  • Blog
Subscribe Feed

How Sharepoint stores User Data

Posted by Alec on Wed, 07 Apr 2010, in Sharepoint   

Lately I had fun digging into Sharepoint database and see how the monster was built and what its database schema looking like. Well, it's pretty smart the way it was built but it's also a pain for developers to understand and even to play with it, if they have to. With the business that I am working for, we have to create reports for corporates, which forces us to having to dig into Sharepoint database directly, even though I read a lot of posts saying that is not recommended by Microsoft.

See, the way Sharepoint stores data is a pain. All user data is stored in a table called "AllUserData", which is a big table of hundreds of columns. This table has some important columns for example, tp_ListId (the list which the data row belongs to), tp_RowOrdinal (this one is fun!) and a long list of different nvarchar(s), ntext(s), etc.

Whenever we create a list, there is a new entry added to dbo.AllLists table, which itself has a tp_Fields column. This column is of text datatype, but within it, stores the list of fields of that list in an XML format. If you break each of these fields by a line break, you can see that each of these field in the XML string has attributes such as Name, DisplayName (if the column is a user-defined one), ColName (the actual column name where Sharepoint stores the data).

For example, generally Title column has the ColName of "nvarchar1", so what that means is Sharepoint will store the Title value in "nvarchar1" column of AllUserData table! And if we have ten columns with nvarchar type, Sharepoint will store the first eight in one row with "RowOrdinal" as 0, and then the next  in another row with "RowOrdinal" as 1.

While that might be smart for those who created Sharepoint, it's a pain for us, developers or business analysis to talk to the database because we will have no idea which field (that we created) a column refers to.

In addition, just for more confusions, a Site that we see in Sharepoint interface might not be a "Site" in database world. If you open up dbo.Webs table, that stores all the so called "Sites" we created in Sharepoint interface. In reality, they are treated as "Web" in the data world. I guess, from the Sharepoint front-end side of view, a site stays in a Site Collection (which is the real site stored in the database), and the database just stores "Site" as "web".

Comments Be the first to write a comment. Comment gets approved before publishing.

Post Your Comment

 
 
   

Search

 

Latest Posts

  • List Attachments Open as Read Only
  • Website finally back up from Google's block
  • Sys.WebForms.PageRequestManagerParserErrorException
  • How Google treats Content Duplication
  • How to create HTML column in Sharepoint List View
  • How Sharepoint stores User Data
  • How to send email via Sharepoint
  • Malaysia Airlines launched iPhone Application: MHMobile
  • Intranet, the next big market
  • How to retrieve and update from a multi choice Checkboxlist ...

Categories

  • Browsers (1)
  • Projects (1)
  • Web Design (7)
  • Sharepoint (21)
  • Telerik (5)
  • Wordpress (1)
  • Internet (2)
  • SQL (5)
  • LINQ (3)
  • ASP.NET C# (34)
  • JavaScripts (3)
  • IIS (0)
  • Industry (1)
  • Tools (8)
  • SEO (5)

Archives

  • September 2010 (1)
  • August 2010 (1)
  • May 2010 (1)
  • April 2010 (3)
  • March 2010 (5)
  • February 2010 (4)
  • January 2010 (11)
  • November 2009 (3)
  • October 2009 (1)
  • September 2009 (9)
  • August 2009 (3)
  • July 2009 (4)
  • June 2009 (1)
  • May 2009 (2)
  • April 2009 (8)
  • March 2009 (6)
  • February 2009 (2)
© Copyright 2009 Alec Tang. All Rights Reserved.
This site is conform to W3C Standard XHTML & CSS