Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / General / Security / April 2005

Tip: Looking for answers? Try searching our database.

Add Database Role to Login Name

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe K. - 27 Apr 2005 22:09 GMT
I have a SQL Server 2000 database that I restore often.

After the database is restored I need to add database security role to Login
Name Chicago\CH-datareader-K.

How would I add the database role 'db_datareader' to Login Name
Chicago\CH-datareader-K that correponds to User Name CH-datareader-K.

Please help me create the correct syntax so I add this to my restore script.

Thanks,
Jens Süßmeyer - 28 Apr 2005 06:26 GMT
Syntax
sp_addrolemember [ @rolename = ] 'role' ,
   [ @membername = ] 'security_account'

So it should be

sp_addrolemember 'db_datareader','CH-datareader-K'

HTH, Jens Suessmeyer.

---

http://www.sqlserver2005.de

---

> I have a SQL Server 2000 database that I restore often.
>
[quoted text clipped - 9 lines]
>
> Thanks,
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.