Wednesday, March 28, 2012

read usergroup for a username with stored procedure

Hi

I wounder if there is a sp in the master db that can give me what usergroup a username is connected to / and or give me info if the username is valid (Windows NT login).

If not: then how do I read what usergroup a username is connected to? sysxlogin table in master db? And can I connect to a sp in master db from another db? Can I create a sp in my db that reads in the master db?

Thanks!!

Best Regards

Staffan

Yes, sp_helpuser

As long as your login has privileges to run system procedures in the master database, you will be able to run the procedure from any database (SQL Server always checks the master database if the procedure starts with sp_ )

sql

No comments:

Post a Comment