简体   繁体   English

SQL Server-将创建表授予架构所有者

[英]SQL Server - grant create table to schema owner

Using SQL Server 2014 Express. 使用SQL Server 2014 Express。 I'm new to SQL Server (more familiar with Oracle). 我是SQL Server的新手(对Oracle更加熟悉)。 I have a schema defined and a user defined as the schema owner. 我定义了一个架构,并将一个用户定义为架构所有者。 I cannot seem to find a way to allow the user to create tables inside the schema without granting db_owner role. 我似乎找不到无法允许用户在不授予db_owner角色的情况下在架构内创建表的方法。

This will not work for my DB because there will be multiple schemas. 这对于我的数据库不起作用,因为将有多个架构。 With this database level role, ie db_owner , the user (schema owner) can create tables in any schema . 使用此数据库级别的角色,即db_owner ,用户(模式所有者)可以在任何模式中创建表。

My goal is to have a schema owner user able to log into the DB and create tables and manage the schema and ONLY their own schema. 我的目标是让架构所有者用户能够登录数据库并创建表并管理该架构,并且只能使用他们自己的架构。

Can someone help me with this? 有人可以帮我弄这个吗? I'm quite frustrated. 我很沮丧

Thanks in advance. 提前致谢。

After much research, I was able to figure out the answer to my own question: 经过大量研究,我能够找出自己的问题的答案:

"Create table" is only a database level permission, cannot be assigned at the schema level. “创建表”仅是数据库级别的权限,不能在架构级别分配。

A user can be defined as the schema owner. 可以将用户定义为架构所有者。 If the user has "Create Table" permissions at the database level and is a schema owner, all tables will be created in the schema he/she owns. 如果用户在数据库级别具有“创建表”权限,并且是架构所有者,则将在他/她拥有的架构中创建所有表。

A user cannot see other schemas unless granted "select" permission at the schema level by the schema owner (or someone with higher level authority). 除非架构所有者(或具有更高权限的人员)在架构级别授予“选择”权限,否则用户无法查看其他架构。 If the user has "Select" at the database level, he/she will see all schemas. 如果用户在数据库级别具有“选择”,则他/她将看到所有模式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM