Change the max length of a field in Sharepoint 2010 User Profile

I have a Sharepoint portal that uses the User Profile Service in order to store user properties.  I created custom fields to hold address data such as Street 1, City, State, Zip.   When I created the fields I didn’t notice that Street 1 was defaulted to 25 characters.   After using the portal for a few weeks I came to realize that 25 characters isn’t large enough for a street address and wanted to increase it to 100 characters.  If you edit the property in the User Profile the length setting is grayed and cannot be changed.   A requirement I had was the name of the field needed to stay the same since I had a custom Sharepoint webpart using the field.

I figured that there were 2 options to make the field larger.
Use a temp field and recreate the orginal field (I did not use this method)
1. Create a new temporary field.
2. Move the data to the new temp field
3. Delete the original field
4. Recreate the field with the correct size (100 characters)
5. Move the data from the temp to the correct field
6. Delete the temp field

Modify the Sharepoint SQL database and change the length (Used this method)
1. Ran the following SQL statement on the User Profile Service Application_ProfileDb_… database
update dbo.PropertyList
set length=100
where PropertyName = ‘Street1’
2. Do a iisreset
*** It is not recommended by Microsoft to modify the Sharepoint SQL databases directly, but sometimes you just need to get things done ***

One thought on “Change the max length of a field in Sharepoint 2010 User Profile

Leave a comment