question

Abichu avatar image
Abichu asked

I want to write sql script that can return who is a member of SA role.

we use domain account. there is a database that holds the detailed information of every employee. I want to write a script that can return FirstName, LastName and loginName. I want me to join syslogin and the user table in a user database.

sql-server-2012
5 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sp_lock avatar image sp_lock commented ·

Can we assume you are using Windows Auth and within the Employee database you sort the Windows domain name?

0 Likes 0 ·
Abichu avatar image Abichu sp_lock commented ·

yes, thats correct. all our employees are AD members. we create login for AD accounts whenever we want our employee use a database.

0 Likes 0 ·
borispinsky avatar image borispinsky commented ·

Sa role? Did you mean sysadmin role?

0 Likes 0 ·
ThomasRushton avatar image ThomasRushton ♦♦ commented ·

What about windows AD groups who have sa rights?

-1 Like -1 ·
Abichu avatar image Abichu ThomasRushton ♦♦ commented ·

we want to get those too

0 Likes 0 ·

0 Answers

·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.