SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 User Rights for Particular Databases
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Kalaiselvan
Posting Yak Master

India
110 Posts

Posted - 12/03/2012 :  12:43:27  Show Profile  Reply with Quote
Hi,
we are using SQL server 2008 as our DB server. And Admin User is used for all Transactions and Applications.
Now a New Database is created for Payroll purpose. DB Name: PAYROLL. Need to give User Rights for this particular DB for single User and not even for Admin user.

New User: PayrollUser = Can access this Database.
Admin User: Can access all Database other than PAYROLL DB.

Please help me how to provide the Rights for New User and Deny the Rights for Admin User.


Regards,
Kalaiselvan R
Love Yourself First

Regards,
Kalai

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/03/2012 :  14:17:39  Show Profile  Reply with Quote
If you mean by "admin user", you mean a login who is a member of the sysadmin role on the server, then you cannot prevent that user from accessing any database they choose to, on that server.
Go to Top of Page

Kalaiselvan
Posting Yak Master

India
110 Posts

Posted - 12/04/2012 :  00:46:05  Show Profile  Reply with Quote
K. Then can we create a User who can access All DB except PAYROLL DB. And another User to access only PAYROLL DB.


Regards,
Kalai
Go to Top of Page

sodeep
Flowing Fount of Yak Knowledge

USA
7174 Posts

Posted - 12/05/2012 :  16:00:12  Show Profile  Reply with Quote
Yes unless they are member of sysadmin
Go to Top of Page

Kalaiselvan
Posting Yak Master

India
110 Posts

Posted - 12/10/2012 :  12:26:57  Show Profile  Reply with Quote
Guide me to create a User to access only the PAYROLL DB and not other DB's.

Regards,
Kalai
Go to Top of Page

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/10/2012 :  12:54:01  Show Profile  Reply with Quote
In SSMS object explorer, at the server level, right click on Security -> Logins and select New Login. Select/specify the appropriate fields. To grant access to the specific database, under the User Mapping tab, click on the database name and grant appropriate permissions.

For end users, I usually grant only public role and then grant permissions on specific stored procedures as required.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000