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)
 create a user login to my db with only a few permi
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

sebastian11c
Posting Yak Master

129 Posts

Posted - 11/06/2012 :  16:16:29  Show Profile  Reply with Quote
hi there

i have a sql server 2008 r2 and i want to create a user with login , that only have access to a database called "company" and inside the databse company he can only select , update , and insert in 3 tables called " products", "sevices", "clients", and run only one stored procedured called "insert_new_clients" and thats it, he cant acces anything else, no system database, no other sp, no other tables, and obviously he cant modified his permissions,

am a newbie in sql server so i need you help

many thanks in advanced

regards

Edited by - sebastian11c on 11/06/2012 16:26:01

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 11/06/2012 :  16:29:32  Show Profile  Reply with Quote
Are you looking for T-Sql code or simply how to navigate the Management Studio interface?

Sounds like you have it already. Just be sure not to add the login to any server roles and not to add the user to any database roles. That way the user has no permissions that you didn't explicitly grant. Furthermore if the SPs perform the insert/update/delete work and the SPs are in the same database as the tables then you don't even need to grant insert,update,delete on the tables. Just EXECUTE on the Procedure(s) will be sufficient.

Be One with the Optimizer
TG
Go to Top of Page

sebastian11c
Posting Yak Master

129 Posts

Posted - 11/06/2012 :  16:57:47  Show Profile  Reply with Quote
thanks tg for your reply

but i dont have it at all, could you explain me please with an example, ,it can be with t-sql or managemente studio interface,,
thanks for your help

regards
Go to Top of Page

sebastian11c
Posting Yak Master

129 Posts

Posted - 11/07/2012 :  08:31:32  Show Profile  Reply with Quote
quote:
Originally posted by TG

Are you looking for T-Sql code or simply how to navigate the Management Studio interface?

Sounds like you have it already. Just be sure not to add the login to any server roles and not to add the user to any database roles. That way the user has no permissions that you didn't explicitly grant. Furthermore if the SPs perform the insert/update/delete work and the SPs are in the same database as the tables then you don't even need to grant insert,update,delete on the tables. Just EXECUTE on the Procedure(s) will be sufficient.

Be One with the Optimizer
TG



please tg, i dint know how to do it, give me an extra hand

regards
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6059 Posts

Posted - 11/07/2012 :  10:09:01  Show Profile  Reply with Quote
>>please tg, i dint know how to do it, give me an extra hand

- Open "Microsoft Sql Server Management Studio"
- Make sure that "Object Explorer" is open (if not then from context menu: View | Object explorer)
- Find your server in tree view (if not there then click: Connect | Database Engine)
- Expand the tree under your server
- Expand "Logins"
- Right Click "Logins" then click "New Login".

See if you can take it from there. Be sure to look through the "select a page" items. If you still have problems then post a specific question.

EDIT:
Once you have the login created:
- expand databases
- expand the database you want the login to access.
- expand "Security"
- expand "Users"
- If the user is not there then right-click | new users
- If it is there then right-click the user | Properties
- Add specific permissions in the "Securables" page

Be One with the Optimizer
TG

Edited by - TG on 11/07/2012 10:13:31
Go to Top of Page

sebastian11c
Posting Yak Master

129 Posts

Posted - 11/07/2012 :  10:29:19  Show Profile  Reply with Quote
lovely..

thanks a lot
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.05 seconds. Powered By: Snitz Forums 2000