SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Create objects only in one schema


Create objects only in one schema

Author
Message
na1774
na1774
SSC Veteran
SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)SSC Veteran (245 reputation)

Group: General Forum Members
Points: 245 Visits: 273
Hi All,

The issue is I have to give permisions to a user just to create objects in only one schema and deny creations in other schemas.

I am a little confused here. If I give a database scoped permission to create table then the user will be able to create tables in all the schemas.

I was planning to give a exculsive deny create on all the schemas other than the schema in which user can create the tables.

But there is no schema scoped permission to deany table creation.

Can any one help me acheive this goal?
RBarryYoung
RBarryYoung
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15530 Visits: 9518
First, you should *not* need to use any DENYs unless you've already given your user implicit permissions that you need to override explicitly. And in general you do not want to use DENY unless you absolutely have to because it really tends to provoke unintended side-effects.

The Database permission CREATE TABLE does allow a user to Create Tables, but, it alone does not give them any access to any of the schemas within your database. If you also give the user the ALTER permission on a schema, then the two permissions in combination will allow them to CREATE TABLE in that schema. But they can *only* create tables and *only* within that schema.

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Orlando Colamatteo
Orlando Colamatteo
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15723 Visits: 14396
na1774 (9/8/2012)
Hi All,

The issue is I have to give permisions to a user just to create objects in only one schema and deny creations in other schemas.

I am a little confused here. If I give a database scoped permission to create table then the user will be able to create tables in all the schemas.

I was planning to give a exculsive deny create on all the schemas other than the schema in which user can create the tables.

But there is no schema scoped permission to deany table creation.

Can any one help me acheive this goal?

In other words, your assertion above (bolded added) is incorrect.

USE [YourDatabase];
GRANT CREATE TABLE TO [YourUser];
GRANT ALTER ON SCHEMA::[YourSchema] TO [YourUser];



__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
RBarryYoung
RBarryYoung
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15530 Visits: 9518
Exactly, I was just trying to say it in a more positive way. :-)

-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Orlando Colamatteo
Orlando Colamatteo
SSCoach
SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)SSCoach (15K reputation)

Group: General Forum Members
Points: 15723 Visits: 14396
Maybe. People learn in different ways. It was stated, but may not have been completely clear to the OP or other readers what you were pointing out so I added a more direct approach. Hopefully no feelings were hurt in the construction of this thread :-)

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search