0
votes

I have a customer that is using Sharepoint 2010 as a repository for CRM documents, but has defined two custom user defined columns in Sharepoint to house the document GUID & document type. He spends most of his time in SQL, so has been querying nvarchar11 & navarchar12 for this data. But the columns were not always added in the same order, so the GUID that is usually in 11 can sometimes be in 12 or 13, depending on the Library. Is there any way to specifically map/re-map the GUID to nvarchar11 & the type to nvarchar12 in the AllUserData table in the SQL Content Database?

1

1 Answers

0
votes

If you are willing to go down the route of creating/defining your lists as part of custom list templates (i.e. lots of tweaking of XML files) you will get access to the xml element called Field https://msdn.microsoft.com/en-us/library/office/ms437580.aspx which gives you the attribute ColName which has this description:

Optional Text. An internal attribute that defines the mapping of the field to the physical storage name for this field. This must be a valid name in the underlying database and must be identical to the name used in the database table. If not specified, the server generates a column name that does not collide with any existing column names and that contains only characters that are allowed by Microsoft SQL Server.

With that said, I'd strongly advise you against doing this on a couple of fronts.

  1. Creating/maintaining list templates is arcane and annoying
  2. You are causing yourself an upgrade challenge
  3. You shouldn't be encouraging people from directly querying the content database tables. That is strongly discouraged by Microsoft: https://support.microsoft.com/en-us/help/841057/support-for-changes-to-the-databases-that-are-used-by-office-server-pr