有什么方法可以将 Sharepoint 2010 用户定义的列映射到 sql 中的特定列?
Is there any way to map a Sharepoint 2010 user defined column to a specific column in sql?
我有一个客户使用 Sharepoint 2010 作为 CRM 文档的存储库,但在 Sharepoint 中定义了两个自定义用户定义的列来存放文档 GUID 和文档类型。他大部分时间都花在 SQL 上,因此一直在查询 nvarchar11 和 navarchar12 以获取此数据。但是列并不总是以相同的顺序添加,因此通常为 11 的 GUID 有时可以为 12 或 13,具体取决于库。有什么方法可以在 SQL 内容数据库的 AllUserData table 中将 GUID 明确 map/re-map 到 nvarchar11 并将类型指定到 nvarchar12?
如果您愿意按照 creating/defining 的路线将您的列表作为自定义列表模板的一部分(即对 XML 文件进行大量调整),您将可以访问 xml 元素称为 Field https://msdn.microsoft.com/en-us/library/office/ms437580.aspx,它为您提供属性 ColName,其描述如下:
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.
话虽如此,我强烈建议您不要在几个方面这样做。
- Creating/maintaining 列表模板神秘而烦人
- 您正在给自己带来升级挑战
- 您不应该鼓励人们直接查询内容数据库表。 Microsoft 强烈反对这样做:https://support.microsoft.com/en-us/help/841057/support-for-changes-to-the-databases-that-are-used-by-office-server-pr
我有一个客户使用 Sharepoint 2010 作为 CRM 文档的存储库,但在 Sharepoint 中定义了两个自定义用户定义的列来存放文档 GUID 和文档类型。他大部分时间都花在 SQL 上,因此一直在查询 nvarchar11 和 navarchar12 以获取此数据。但是列并不总是以相同的顺序添加,因此通常为 11 的 GUID 有时可以为 12 或 13,具体取决于库。有什么方法可以在 SQL 内容数据库的 AllUserData table 中将 GUID 明确 map/re-map 到 nvarchar11 并将类型指定到 nvarchar12?
如果您愿意按照 creating/defining 的路线将您的列表作为自定义列表模板的一部分(即对 XML 文件进行大量调整),您将可以访问 xml 元素称为 Field https://msdn.microsoft.com/en-us/library/office/ms437580.aspx,它为您提供属性 ColName,其描述如下:
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.
话虽如此,我强烈建议您不要在几个方面这样做。
- Creating/maintaining 列表模板神秘而烦人
- 您正在给自己带来升级挑战
- 您不应该鼓励人们直接查询内容数据库表。 Microsoft 强烈反对这样做:https://support.microsoft.com/en-us/help/841057/support-for-changes-to-the-databases-that-are-used-by-office-server-pr