POST POST

JUN
7
2021

Add user to role in sql server

ORIGINALLY POSTED TO: https://blog.simontimms.com/2021/06/07/add-user-to-role

This can be done with

1
sp_addrolemember @rolename = 'role', @membername = 'security_account'

example

1
sp_addrolemember @rolename = 'db_owner', @membername = 'evil_hacker_account'

another example

1
sp_addrolemember @rolename = 'db_datareader', @membername = 'datafactory'

Simon Timms

Email Email
Web Web
Twitter Twitter
GitHub GitHub
RSS

Looking for someone else?

You can find the rest of the Western Devs Crew here.

© 2015 Western Devs. All Rights Reserved. Design by Karen Chudobiak, Graphic Designer