Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how can we find the user rols

Author  Topic 

boreddy
Posting Yak Master

172 Posts

Posted - 2009-03-12 : 06:34:36
how can we get the user role in systables

darkdusky
Aged Yak Warrior

591 Posts

Posted - 2009-03-12 : 08:44:43
Select * from (
SELECT [server_principals].[name]
,[server_principals].[type_desc]

,R.name as RoleName

FROM [master].[sys].[server_principals]
JOIN
[master].[sys].[server_role_members]
ON
[server_role_members].[member_principal_id] = [server_principals].principal_id
Right outer Join
(
SELECT name, principal_id

FROM [master].[sys].[server_principals]
) as R
on R.principal_id = [role_principal_id]
) as T
where name is not null
order by name
Go to Top of Page

boreddy
Posting Yak Master

172 Posts

Posted - 2009-03-12 : 08:59:12
Thanks for your help
Go to Top of Page
   

- Advertisement -