Login, User, and Role store procedure 
Author Message
 Login, User, and Role store procedure
Hi,
Could someone tell me how to create a store procedure which will display
login name, user name and  its role to all tables when a user access to a
database.
Thanks
T.H.


Sat, 29 May 2004 05:25:12 GMT
 Login, User, and Role store procedure

Sintax could be something like:
SELECT USER                        /* DATABASE USER */
SELECT SYSTEM_USER    /* NT-SQL LOGIN */

/* USER INFORMATION AND IT'S ROLES Y THE DB */
SELECT US.*, SR.NAME AS Role
FROM SYSUSERS AS US JOIN SYSMEMBERS
 ON US.UID=SYSMEMBERS.MEMBERUID
JOIN SYSUSERS AS SR
 ON SYSMEMBERS.GROUPUID=SR.UID

Hope this helps you in the right direction

Javier Loria
MVP


Quote:
> Hi,
> Could someone tell me how to create a store procedure which will display
> login name, user name and  its role to all tables when a user access to a
> database.
> Thanks
> T.H.



Sat, 29 May 2004 06:57:15 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. Creating Role to execute user stored procedures?

2. user login in stored procedure

3. LOGIN - USER - ROLE

4. How to find roles of a login/user

5. Identifying User Stored Procedures vs. System Stored Procedures

6. Changing User Stored Procedures to System Stored Procedures?

7. User with server role / database role

8. DTS fail while transfer store proc for users with role - db_owner

9. Do built-in roles override user-defined roles?

10. user defined role and public role

11. Database role to execute user stored procs

12. App.role & stored procedures


 
Powered by phpBB® Forum Software