You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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,
11
+
prin.type_desc AS LoginType,
12
+
isnull(USER_NAME(mem.role_principal_id),'''') AS AssociatedRole ,create_date,modify_date
13
+
FROM sys.database_principals prin
14
+
LEFT OUTER JOIN sys.database_role_members mem ON prin.principal_id=mem.member_principal_id
15
+
WHERE prin.sid IS NOT NULL and prin.sid NOT IN (0x00) and
16
+
prin.is_fixed_role <> 1 AND prin.name NOT LIKE ''##%'''
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,
11
+
prin.type_desc AS LoginType,
12
+
isnull(USER_NAME(mem.role_principal_id),'''') AS AssociatedRole ,create_date,modify_date
13
+
FROM sys.database_principals prin
14
+
LEFT OUTER JOIN sys.database_role_members mem ON prin.principal_id=mem.member_principal_id
15
+
WHERE prin.sid IS NOT NULL and prin.sid NOT IN (0x00) and
16
+
prin.is_fixed_role <> 1 AND prin.name NOT LIKE ''##%'''
0 commit comments