<?xml version="1.0" encoding="utf-8"?>
<Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
  <Body>
    <ReportItems>
      <Tablix Name="Tablix1">
        <TablixBody>
          <TablixColumns>
            <TablixColumn>
              <Width>2.93333in</Width>
            </TablixColumn>
            <TablixColumn>
              <Width>3.34167in</Width>
            </TablixColumn>
            <TablixColumn>
              <Width>2.14167in</Width>
            </TablixColumn>
            <TablixColumn>
              <Width>4.99166in</Width>
            </TablixColumn>
          </TablixColumns>
          <TablixRows>
            <TablixRow>
              <Height>0.45in</Height>
              <TablixCells>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox9">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>="Database Users - " &amp; First(Fields!ServerName.Value, "ServerName")</Value>
                              <Style>
                                <FontSize>18pt</FontSize>
                                <Color>White</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style>
                            <TextAlign>Left</TextAlign>
                          </Style>
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox9</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>DarkBlue</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                    <ColSpan>4</ColSpan>
                  </CellContents>
                </TablixCell>
                <TablixCell />
                <TablixCell />
                <TablixCell />
              </TablixCells>
            </TablixRow>
            <TablixRow>
              <Height>0.3in</Height>
              <TablixCells>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox11">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>Click Here to see the Query</Value>
                              <ActionInfo>
                                <Actions>
                                  <Action>
                                    <Drillthrough>
                                      <ReportName>DatabaseUserCode</ReportName>
                                    </Drillthrough>
                                  </Action>
                                </Actions>
                              </ActionInfo>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value xml:space="preserve">   </Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value>|</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>Gray</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value xml:space="preserve">   </Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value>Go To Report Library</Value>
                              <ActionInfo>
                                <Actions>
                                  <Action>
                                    <Drillthrough>
                                      <ReportName>ReportLibrary</ReportName>
                                    </Drillthrough>
                                  </Action>
                                </Actions>
                              </ActionInfo>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value xml:space="preserve">  </Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value> |</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>Gray</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value xml:space="preserve">   </Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value xml:space="preserve"> </Value>
                              <ActionInfo>
                                <Actions>
                                  <Action>
                                    <Drillthrough>
                                      <ReportName>DatabaseSpecificReports</ReportName>
                                    </Drillthrough>
                                  </Action>
                                </Actions>
                              </ActionInfo>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value>Go To Main Report</Value>
                              <ActionInfo>
                                <Actions>
                                  <Action>
                                    <Drillthrough>
                                      <ReportName>=IIF(First(Fields!ProductMajorVersion.Value, "Version") = 10 and First(Fields!EngineEdition.Value, "ServerProperty") &lt;&gt; 5, "MainReport2008", 
IIF(First(Fields!EngineEdition.Value, "ServerProperty") = 5, Nothing, 
IIF(First(Fields!ProductMajorVersion.Value, "Version") &gt; 10 and First(Fields!EngineEdition.Value, "ServerProperty") &lt;&gt; 5, "MainReport", Nothing)))</ReportName>
                                    </Drillthrough>
                                  </Action>
                                </Actions>
                              </ActionInfo>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>=IIF(First(Fields!ProductMajorVersion.Value, "Version") = 10, "DarkBlue", IIF(First(Fields!EngineEdition.Value, "ServerProperty") = 5, "LightSteelBlue", "DarkBlue"))</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style>
                            <TextAlign>Left</TextAlign>
                          </Style>
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox11</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>LightSteelBlue</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                    <ColSpan>4</ColSpan>
                  </CellContents>
                </TablixCell>
                <TablixCell />
                <TablixCell />
                <TablixCell />
              </TablixCells>
            </TablixRow>
            <TablixRow>
              <Height>0.38667in</Height>
              <TablixCells>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox1">
                      <CanGrow>true</CanGrow>
                      <UserSort>
                        <SortExpression>=Fields!DBName.Value</SortExpression>
                      </UserSort>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>Database Name</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>White</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox1</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>DimGray</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox3">
                      <CanGrow>true</CanGrow>
                      <UserSort>
                        <SortExpression>=Fields!User_Name.Value</SortExpression>
                      </UserSort>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>User Name</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>White</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox3</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>DimGray</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox5">
                      <CanGrow>true</CanGrow>
                      <UserSort>
                        <SortExpression>=Fields!Login_Type.Value</SortExpression>
                      </UserSort>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>Login Type</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>White</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox5</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>DimGray</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox7">
                      <CanGrow>true</CanGrow>
                      <UserSort>
                        <SortExpression>=Fields!Permissions_user.Value</SortExpression>
                      </UserSort>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>Roles</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>White</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox7</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>DimGray</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
              </TablixCells>
            </TablixRow>
            <TablixRow>
              <Height>0.35833in</Height>
              <TablixCells>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="DBName">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>=Fields!DBName.Value</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>DBName</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>=IIF(ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "SILVER")</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="User_Name">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>=Fields!User_Name.Value</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>User_Name</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>=IIF(ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "SILVER")</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Login_Type">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>=Fields!Login_Type.Value</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Login_Type</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>=IIF(ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "SILVER")</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Permissions_user">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>=Fields!Permissions_user.Value</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style />
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Permissions_user</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>=IIF(ROWNUMBER(NOTHING) MOD 2, "LIGHTBLUE", "SILVER")</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                  </CellContents>
                </TablixCell>
              </TablixCells>
            </TablixRow>
            <TablixRow>
              <Height>0.5in</Height>
              <TablixCells>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox4">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>From: </Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                            <TextRun>
                              <Value>https://stackoverflow.com/questions/37114898/how-can-i-get-the-list-of-all-database-name-with-their-username-and-roles-in-t-s/37116656#37116656</Value>
                              <Style>
                                <FontStyle>Normal</FontStyle>
                                <FontSize>14pt</FontSize>
                                <FontWeight>Normal</FontWeight>
                                <TextDecoration>None</TextDecoration>
                                <Color>DarkBlue</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style>
                            <TextAlign>Left</TextAlign>
                          </Style>
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox4</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>LightSteelBlue</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                    <ColSpan>4</ColSpan>
                  </CellContents>
                </TablixCell>
                <TablixCell />
                <TablixCell />
                <TablixCell />
              </TablixCells>
            </TablixRow>
            <TablixRow>
              <Height>0.425in</Height>
              <TablixCells>
                <TablixCell>
                  <CellContents>
                    <Textbox Name="Textbox2">
                      <CanGrow>true</CanGrow>
                      <KeepTogether>true</KeepTogether>
                      <Paragraphs>
                        <Paragraph>
                          <TextRuns>
                            <TextRun>
                              <Value>="End Of Report                  Completed By: " &amp; UCASE(User!UserID) &amp; " on " &amp; Globals!ExecutionTime</Value>
                              <Style>
                                <FontSize>14pt</FontSize>
                                <Color>White</Color>
                              </Style>
                            </TextRun>
                          </TextRuns>
                          <Style>
                            <TextAlign>Left</TextAlign>
                          </Style>
                        </Paragraph>
                      </Paragraphs>
                      <rd:DefaultName>Textbox2</rd:DefaultName>
                      <Style>
                        <Border>
                          <Color>LightGrey</Color>
                          <Style>Solid</Style>
                        </Border>
                        <BackgroundColor>DarkBlue</BackgroundColor>
                        <VerticalAlign>Middle</VerticalAlign>
                        <PaddingLeft>2pt</PaddingLeft>
                        <PaddingRight>2pt</PaddingRight>
                        <PaddingTop>2pt</PaddingTop>
                        <PaddingBottom>2pt</PaddingBottom>
                      </Style>
                    </Textbox>
                    <ColSpan>4</ColSpan>
                  </CellContents>
                </TablixCell>
                <TablixCell />
                <TablixCell />
                <TablixCell />
              </TablixCells>
            </TablixRow>
          </TablixRows>
        </TablixBody>
        <TablixColumnHierarchy>
          <TablixMembers>
            <TablixMember />
            <TablixMember />
            <TablixMember />
            <TablixMember />
          </TablixMembers>
        </TablixColumnHierarchy>
        <TablixRowHierarchy>
          <TablixMembers>
            <TablixMember>
              <KeepWithGroup>After</KeepWithGroup>
            </TablixMember>
            <TablixMember>
              <KeepWithGroup>After</KeepWithGroup>
            </TablixMember>
            <TablixMember>
              <KeepWithGroup>After</KeepWithGroup>
            </TablixMember>
            <TablixMember>
              <Group Name="Details" />
            </TablixMember>
            <TablixMember>
              <KeepWithGroup>Before</KeepWithGroup>
            </TablixMember>
            <TablixMember>
              <KeepWithGroup>Before</KeepWithGroup>
            </TablixMember>
          </TablixMembers>
        </TablixRowHierarchy>
        <DataSetName>DBUsers</DataSetName>
        <Height>2.42in</Height>
        <Width>13.40833in</Width>
        <Style>
          <Border>
            <Style>Solid</Style>
          </Border>
        </Style>
      </Tablix>
    </ReportItems>
    <Height>2.53333in</Height>
    <Style />
  </Body>
  <Width>13.73in</Width>
  <Page>
    <PageHeight>455in</PageHeight>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
  </Page>
  <AutoRefresh>0</AutoRefresh>
  <DataSources>
    <DataSource Name="Local">
      <ConnectionProperties>
        <DataProvider>SQL</DataProvider>
        <ConnectString>Data Source=LocalHost;Initial Catalog=master</ConnectString>
        <IntegratedSecurity>true</IntegratedSecurity>
      </ConnectionProperties>
      <rd:SecurityType>Integrated</rd:SecurityType>
      <rd:DataSourceID>8f3a52e0-bd52-4a8f-a4da-7f461ebffcb7</rd:DataSourceID>
    </DataSource>
  </DataSources>
  <DataSets>
    <DataSet Name="DBUsers">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED

DECLARE @DB_USers TABLE
								(TypeOfAudit VARCHAR(50), DBName sysname, UserName sysname null, LoginType sysname, AssociatedRole varchar(max))
 
								INSERT @DB_USers
								EXEC sp_MSforeachdb
 
										'
										use [?]
										SELECT ''Database User Audit'',
											''?'' AS DB_Name,
										case prin.name when ''dbo'' then prin.name + '' (''+ (select SUSER_SNAME(owner_sid) from master.sys.databases where name =''?'') + '')'' else prin.name end AS UserName,
										prin.type_desc AS LoginType,
										isnull(USER_NAME(mem.role_principal_id),'''') AS AssociatedRole 
										FROM sys.database_principals prin
										LEFT OUTER JOIN sys.database_role_members mem ON prin.principal_id=mem.member_principal_id
										WHERE prin.sid IS NOT NULL and prin.sid NOT IN (0x00) and
										prin.is_fixed_role &lt;&gt; 1 AND prin.name NOT LIKE ''##%'''
 
								SELECT
									  TypeOfAudit  AS 'Setting'
									, CONVERT(VARCHAR(50),DBName) AS 'DBName'
									, CONVERT(VARCHAR(50),UserName) AS 'User Name'
									, CONVERT(VARCHAR(50),LoginType) as 'Login Type'
									,
										STUFF(
										(
										SELECT ',' + CONVERT(VARCHAR(500),AssociatedRole)
								FROM @DB_USers user2
								WHERE user1.DBName=user2.DBName AND user1.UserName=user2.UserName
 
								FOR XML PATH('')
								)
								,1,1,'') AS Permissions_user
								FROM @DB_USers user1
								GROUP BY TypeOfAudit, DBName,UserName ,LoginType 
								ORDER BY DBName,UserName</CommandText>
      </Query>
      <Fields>
        <Field Name="Setting">
          <DataField>Setting</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="DBName">
          <DataField>DBName</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="User_Name">
          <DataField>User Name</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="Login_Type">
          <DataField>Login Type</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
        <Field Name="Permissions_user">
          <DataField>Permissions_user</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
    <DataSet Name="ServerName">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>Select @@servername AS 'ServerName'</CommandText>
      </Query>
      <Fields>
        <Field Name="ServerName">
          <DataField>ServerName</DataField>
          <rd:TypeName>System.String</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
    <DataSet Name="Version">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>SELECT  SERVERPROPERTY('ProductMajorversion') AS 'ProductMajorVersion'</CommandText>
      </Query>
      <Fields>
        <Field Name="ProductMajorVersion">
          <DataField>ProductMajorVersion</DataField>
          <rd:TypeName>System.Object</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
    <DataSet Name="ServerProperty">
      <Query>
        <DataSourceName>Local</DataSourceName>
        <CommandText>SELECT ServerProperty('EngineEdition') AS 'EngineEdition'</CommandText>
      </Query>
      <Fields>
        <Field Name="EngineEdition">
          <DataField>EngineEdition</DataField>
          <rd:TypeName>System.Object</rd:TypeName>
        </Field>
      </Fields>
    </DataSet>
  </DataSets>
  <rd:ReportUnitType>Inch</rd:ReportUnitType>
  <rd:ReportID>8b5c3615-4e76-4964-93cd-2f2379d37962</rd:ReportID>
</Report>