1

我的要求是执行更改的用户不能系统管理员(它可以拥有所有其他权限,但不是系统管理员)。

我正在从本地服务器运行查询,该查询应该修改远程服务器

EXEC ('ALTER DATABASE REMOTEDB MODIFY FILEGROUP ftfg_REMOTEDB NAME=ftfg_REMOTEDB') at [REMOTESERVER]

一旦我向用户添加 sysadmin 权限但没有权限,此查询将起作用,它会给出以下错误:

The server principal "USERWITHOUTSYSADMIN" is not able to access the database "REMOTEDB" under the current security context.

我在 SQL 服务 2008 上。

请帮忙!

4

3 回答 3

1

经过大量研究:这是不可能的:(

于 2011-05-23T14:35:09.180 回答
0

Put the EXEC command in a stored procedure and grant execute on the procedure to the user. It won't STOP a sysadmin from executing it, but it will allow others to execute it as well. Be VERY, VERY careful with this!

于 2010-09-15T17:48:13.480 回答
0

你能允许用户冒充具有适当权限的人吗?

EXEC ('ALTER DATABASE REMOTEDB MODIFY FILEGROUP ftfg_REMOTEDB NAME=ftfg_REMOTEDB') 
    AS USER = 'UserWithAppropriatePermissions'
    AT [REMOTESERVER]
于 2010-09-15T18:07:29.647 回答