|
Hi I have created new database in my server. in server i have 30 users how can I gave the access permission to all users in server? is any query to give permission in single transaction?
(comments are locked)
|
|
First of all I would not blindly give all the users permissions in one go without reviewing it. It could lead to a very bad situation. So for the sake of less work and simplicity but with a better approach could be to have a batch printed which would be run after reviewing thoroughly. Following is a snippet which would add all SQL Logins which are not disabled to db_datareader database role. (CURSOR used intentionally, so modification could be easy)
(comments are locked)
|
|
For simplicity have all of your users put into an active directory security group then add that group to your server logins and then add that login as a database user with the permission you need it to have
(comments are locked)
|
|
If you are worried about fixing orphan users after a restore of the database run the following query to fix them.
(comments are locked)
|
|
If you want to have this setting applied for all databases which are still to be created on a server, you could try making the changes in the The Exactly what I thought when I read the header
Oct 16 '12 at 07:44 AM
DirkHondong
(comments are locked)
|


Great thanking you.......... can we assign one by one.........?
it is time consuming........
any other way to reduce the time..........