3

In SQL its possible to have fields that cannot contain duplicate data.

How is this possible in SharePoint?

Lets say you have a list containing values like

ORANGES
APPLES 
PEARS

How do you ensure that the user cannot enter

ORANGES
APPLES 
PEARS
ORANGES

Thanks

JL.
  • 78,954
  • 126
  • 311
  • 459

2 Answers2

3

Looks like this can be done in 2010

If you go to your list settings and click on the column there is the option "Enforce unique values"

Adam Butler
  • 3,023
  • 5
  • 35
  • 40
2

This can't be done out of the box. But there are these community solutions:

Alex Angas
  • 59,219
  • 41
  • 137
  • 210
  • Note: Scot's blog seems to be having some auth issues at the moment. You can read more about his solution on this page: http://www.shillier.com/default.aspx?Paged=TRUE&p_PublishedDate=20090501%2012%3A38%3A59&p_ID=15&View={86C4766F-C635-4F56-BC26-52BFDD3DF7A4}&PageFirstRow=6 – Alex Angas Aug 27 '09 at 11:04
  • Ah - thats typical of JokePoint err I mean SharePoint, I would be dissappointed if it didn't fail me each and every time. Thank you though for your answer. – JL. Aug 27 '09 at 11:05
  • Grrr - and SO's auto hyperlinking doesn't work. Search on the web and you will find his article! http://www.google.co.uk/search?q=unique+site%3Ashillier.com – Alex Angas Aug 27 '09 at 11:06
  • @JL: Completely understand your frustrations. Note that the 2007 version is almost 3 years old and has come a long way since the previous SPS 2003 bringing a huge number of features. The fact that it is so extensible and devs like us can create these solutions that significantly improve it is a credit to the product's design. – Alex Angas Aug 27 '09 at 11:13
  • Alex - do you think MOSS 2010 will have constraints? – JL. Aug 27 '09 at 11:17
  • @JL: There's been nothing mentioned publicly about this so it's too early to say. SharePoint 2010 will make life easier for developers however, see http://sharepoint.microsoft.com/2010/Sneak_Peek/Pages/Developer-Video.aspx – Alex Angas Aug 27 '09 at 11:29