sql-server – 使用SQL Server(2008),您可以在模式中授予create table权限吗?

前端之家收集整理的这篇文章主要介绍了sql-server – 使用SQL Server(2008),您可以在模式中授予create table权限吗?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
sql Server 2008中使用安全性,我正在尝试授予用户CREATE TABLE权限,但仅限于特定架构内. CREATE TABLE权限是否仅适用于数据库级别?

我可以限制用户仅在架构中创建表吗?

我试过了:

USE [databasename]
GRANT CONTROL ON Schema :: [schemaname] TO [username]
GO

USE [databasename]
GRANT ALTER ON Schema :: [schemaname] TO [username]
GO

但是,用户仍然无法在目标模式中创建表.直到我运行它,用户才能创建一个表:

USE [databasename]
GRANT CREATE TABLE to [username]
GO

GRANT

GRANT Database Permissions

解决方法@H_502_22@
根据sql Server 2008的帮助:

Requires CREATE TABLE permission in the database and ALTER permission on the schema in which the table is being created.

我刚刚在测试数据库中使用EXECUTE AS对此进行了测试,并且我能够在具有ALTER权限的模式中创建一个表,但是在dbo模式中没有(我没有授予ALTER权限).因此,只要你没有对模式的ALTER权限过于自由,这应该是这样做的方法.

原文链接:https://www.f2er.com/mssql/81180.html

猜你在找的MsSQL相关文章