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 2012 Forums
 SQL Server Administration (2012)
 create user
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

subhaoviya
Posting Yak Master

India
135 Posts

Posted - 03/26/2014 :  08:07:10  Show Profile  Reply with Quote
Hi,
I have created one database DB1, I need to create access permission for user1 to access only that newly created databse DB1 and need to grand permission for create table, sp,...

How to do that?

I have created user under security-->logins with server role public. but the user1 not able to create table with this permission level.

Thanks
Subha

tkizer
Almighty SQL Goddess

USA
37466 Posts

Posted - 03/26/2014 :  11:49:28  Show Profile  Visit tkizer's Homepage  Reply with Quote
What other permissions will the user need? I suspect db_owner is needed for this user.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jeffw8713
Aged Yak Warrior

USA
808 Posts

Posted - 03/27/2014 :  14:00:47  Show Profile  Reply with Quote
A login grants access to SQL Server, a user in a database grants access to that database. You then grant permissions to that user - in that database through individual permissions or by giving that user a role. You can use one of the built in roles - or create your own.

If you want the user to be able to create tables/stored procedures/functions/etc... in any schema, you can give them the ddl_admin role. For read access to any schema, add them to the db_datareader role and for write access to any schema add them to the db_datawriter role.

To give them the ability to execute any procedure in the 'dbo' schema, use the following: GRANT EXECUTE ON schema::dbo TO {user/role};

If you only want them to be able to do things in their own schema, you just need to create the user and make them an owner of that schema. As owner of the schema, they have full permissions to create objects in that schema and execute procedures in that schema - but no permissions in any other schema unless specifically granted.

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.23 seconds. Powered By: Snitz Forums 2000