Tuesday, March 31, 2009

How to findout list of users and thier permissions in a Database

I have struggled almost a week to findout the solution. From google also I found different suggestions in various sites, but it doesn't met to my requirement. Finally I got up the solution.

1) SELECT UID, NAME, HASDBACCESS,B.* FROM SYSUSERS A INNER JOIN SYSPERMISSIONS B ON A.UID = B.ID

2) Exec sp_helprotect null,'UserName'

for assigning role to login we can use sys procedures like
sp_addrolemember, sp_change_users_login ........

No comments: