SharePoint Survey – Where People and Group field data is stored in database

In general survey data is saved in SQLs AllUserData Table in the Content Database. But the data for a “people and group” field is not. This data is stored in the AllUserDataJunctions table.
You can use the following SQL statement to get the People for a survey list with title “MySurvey”. You should also filter the result by FieldID, if you have more than one people and group field:

SELECT
tp_Title
,tp_RootFolder
,tp_Modified
,AllUserData.tp_Created
,[AllUserDataJunctions].[tp_SiteId]
,[AllUserDataJunctions].[tp_DeleteTransactionId]
,[AllUserDataJunctions].[tp_IsCurrentVersion]
,[AllUserDataJunctions].[tp_DocId]
,[tp_FieldId]
,[AllUserDataJunctions].[tp_Id]
,[tp_Ordinal]
,[tp_SourceListId]
FROM [SP230_Inhalt_Inet].[dbo].[AllUserDataJunctions]
Join [SP230_Inhalt_Inet].dbo.AllUserData on AllUserData.tp_DocId = AllUserDataJunctions.tp_DocId
Join [SP230_Inhalt_Inet].dbo.AllLists on AllLists.tp_ID = [AllUserDataJunctions].tp_SourceListId
Where tp_Title = 'MySurvey'

Leave a Reply

Your email address will not be published. Required fields are marked *