Home > Archive > MS SQL Server security > September 2005 > Adds the group to the database But Security EM









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Adds the group to the database But Security EM
Joe K.

2005-09-18, 11:23 am

I am trying to add domain group with sql server security privileges to a SQL
Server database.

I view the database with SQL Server Enterprise Manager in the database and
users
and notice that domain group is add (sp_addgroup) but this not applied to
the SQL Server security domain group.

Not using the SQL Server Enterprise Manager. How do get the domain group
with
privileges applied to both places (database user , security).



Dan Guzman

2005-09-18, 1:24 pm

> I view the database with SQL Server Enterprise Manager in the database and
> users
> and notice that domain group is add (sp_addgroup) but this not applied to
> the SQL Server security domain group.


sp_addgroup adds a new database role. It is not used to grant an existing
Windows group database access. Also, sp_addgroup is provided only for
backwards compatibility. Use sp_addrole instead.

> Not using the SQL Server Enterprise Manager. How do get the domain group
> with
> privileges applied to both places (database user , security).


From Query Analyzer:

USE MyDatabase
--grant group permissions to connect to SQL Server
EXEC sp_grantlogin 'MyDomain\MyGroup'
--grant group permissions to use this database
EXEC sp_grantdbaccess 'MyDomain\MyGroup'

To setup object security, you can either grant permissions directly to the
Windows account or grant permissions to a SQL Server role and control
security via role membership

--grant object permissions directly
GRANT SELECT ON MyTable TO & #91;MyDomain\MyGroup
]

--grant object permissions to role
GRANT SELECT ON MyTable TO [MyDatabaseRole]
--add group to role
EXEC sp_addrolemember 'MyDatabaseRole', 'MyDomain\MyGroup'


--
Hope this helps.

Dan Guzman
SQL Server MVP

"Joe K." <Joe K.@discussions.microsoft.com> wrote in message
news:229E0AAA-AEED-400D-B082- 3425919A0F85@microso
ft.com...
>I am trying to add domain group with sql server security privileges to a
>SQL
> Server database.
>
> I view the database with SQL Server Enterprise Manager in the database and
> users
> and notice that domain group is add (sp_addgroup) but this not applied to
> the SQL Server security domain group.
>
> Not using the SQL Server Enterprise Manager. How do get the domain group
> with
> privileges applied to both places (database user , security).
>
>
>



Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com