I'm trying to develop a SQL Query to give me the templates and fields associated with them in the repository, along with the groups that have access to those templates and what the field rights are for each group per template. It is hard with the table names to figure out which tables I need to join, but I have managed so far to get the templates, and the fields associated with each template in the query. I am having trouble finding the table or tables to join to list the groups and rights for them. Here is what I have so far:
SELECT DISTINCT Templates.pset_id AS TemplateID, Templates.pset_name AS TemplateName, TemplateFields.prop_id AS FieldID, FieldDef.prop_name AS FieldName FROM MSIGPROD_REP.dbo.propval AS FieldValues JOIN MSIGPROD_REP.dbo.propdef AS FieldDef ON FieldValues.prop_id = FieldDef.prop_id JOIN MSIGPROD_REP.dbo.pset_props AS TemplateFields ON FieldValues.prop_id = TemplateFields.prop_id JOIN MSIGPROD_REP.dbo.propset AS Templates ON TemplateFields.pset_id = Templates.pset_id ORDER BY TemplateName, FieldName
I did find a groupslist table but all it has is a group id and a member id. I don't expect anyone to write the query for me, but any help on which table or tables I am missing would be VERY appreciated, thanks!