Friday, February 24, 2012

Add Database Role to Login Name

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,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
"Joe K." <Joe K.@.discussions.microsoft.com> schrieb im Newsbeitrag
news:F7FFAA86-280E-45B2-93E3-F52AAB86D203@.microsoft.com...
> 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,

No comments:

Post a Comment