Sunday, June 25, 2006

Sharepoint 2007 - Column Limits

Introduction This is a question that I saw being asked in the groups many times, and no one gave a definite answer - how many columns (aka fields) can a sharepoint list hold in the new version?

Executive summary There are no hard limits to the number of fields you can create in a list. However, the more fields you add, the less usable your list is.

Details In the old version (2003) there was a finite number of fields or a mix of fields that you could add. This was well documented in the planing guide, but for the current beta there are no such guidelines. Some people speculated that the limits will remain the same, while others speculated there are no limits, or that the limits are within the thousands.

Well, I was bored and decided to find out the hard way. I wrote this small c# application to create a custom list and add fields to it. I ran it on different number of fields (3 times for each number) and checked the time it took to complete the loop.

Results The results show that sharepoint has no limit that I could reach. I managed to add 2000 text fields to the list without any errors. However, the more fields I added, the more it took to add more fields. This is to be expected, and also - the more fields I added the more time it took to open the list form (for exact numbers I intend to do a future test).

The following chart shows how the preformance of the code that adds the fields to the list degraded the more fields there were in the list. I also tested adding fields in batches (add 100 fields, stop add 100 more and compare the time) and the results were about the same - its not how big your loop is but rather how many fields are there in the list.

It is interesting to note that there doesnt seem to be a limit to the number of fields. I have reached 2000 and succeeded (I will try over night to push the limit...what do you thing? a million?).

More important however is the matter of preformance. You can see the preformance of the code dropping the more fields it has to create.

Regardless, a form with hundreds of fields is not user friendly and is not recommended. My guess is that the only people who will rejoice with this answer are people who intend to use sharepoint as thier data container for custom applications and will display custom forms to users instead of using the sharepoint forms that show all fields at once. I hope this helped answer any question you may have had. If not, post a comment and ask! If you did like it, please kick me (using the link below)

kick it on


Anonymous said...

Hello and great article. Would you mind posting any sample code that you have that you used during your analysis? I am interested in code that deals with site columns and content types that are stored in lists. Did you ever find an upper limint on the number of items a list can contain?



Anonymous said...

Great article... I noticed you only used text fields and that you found there were no limits. Did you try other field types such as choice fields, date, or Yes/No? Are there no limits on these?