创建空间索引的权限

VDM*_*DMT 6 index sql-server spatial

在表上创建空间索引所需的权限,对于这个BOL 说

需要对表或视图具有 ALTER 权限。用户必须是 sysadmin 固定服务器角色或 db_ddladmin 和 db_owner 固定数据库角色的成员。

但是,我发现单独的Alter 权限足以在表上创建空间索引。(没有服务器系统管理员权限)

我在下面创建的测试:(运行每个批次以了解发生了什么)

USE adventureworks;
GO
/* Start these scripts with a priveledged account */

CREATE TABLE employees
(employeedid INT PRIMARY KEY IDENTITY(1,1),
empaddress GEOGRAPHY
)
INSERT INTO employees VALUES(geography::STGeomFromText('LINESTRING(47.656 -12.360, 47.656 -12.343)', 4326))
GO

/* Create our test SQL account with limited access = no securables yet */
CREATE LOGIN LimitedPerms WITH Password = 'pass';
CREATE USER LimitedPerms FOR LOGIN LimitedPerms;
GO

EXEC AS USER='LimitedPerms';
SELECT SUSER_NAME() AS 'CurrentlyLoggedInUser'
GO

/* Should give an error = does not have any rights yet */
CREATE SPATIAL INDEX emp_spatIx on employees(empaddress);
GO

REVERT;
SELECT SUSER_NAME() AS 'CurrentlyLoggedInUser';
GO

/* Give alter permission on table: employees to our test user */
GRANT ALTER ON OBJECT::employees to LimitedPerms;
GO

EXEC AS USER='LimitedPerms';
SELECT SUSER_NAME() AS 'CurrentlyLoggedInUser';
GO

/* Allows user to create index without being a sysadmin! */
CREATE SPATIAL INDEX emp_spatIx on employees(empaddress);
GO

REVERT;
GO
Run Code Online (Sandbox Code Playgroud)

有人愿意测试并报告吗?或告知为什么这样记录?

谢谢

EDIT1:这是在 SQL Server 2008 Enterprise Edition 上测试过的

EDIT2:我已经对Microsoft Connect提出了反馈

VDM*_*DMT 2

Microsoft connect 票证已解决,措辞已更改:

请参考下面的链接(12月1日BOL尚未进行更改)

https://connect.microsoft.com/SQLServer/feedback/details/706766/books-online-suggested-permission-to-create-spatial-index-incorrect