如何在没有 SYSADMIN 权限的情况下更改链接服务器上的数据库?
我的要求是执行更改的用户不能是sysadmin(它可以拥有所有其他权限,但不能拥有sysadmin)。
我正在从本地服务器运行一个查询,该查询应该修改远程服务器
EXEC ('ALTER DATABASE REMOTEDB MODIFY FILEGROUP ftfg_REMOTEDB NAME=ftfg_REMOTEDB') at [REMOTESERVER]
一旦我向用户添加系统管理员权限,该查询就会起作用,但如果没有该权限,它会给出以下错误:
The server principal "USERWITHOUTSYSADMIN" is not able to access the database "REMOTEDB" under the current security context.
我使用的是 SQL Serve 2008。
请帮忙!
My requirement is that user performing alter CANNOT be sysadmin (it can have all other rights but not sysadmin).
I am running a query from local server which should modify a remote one
EXEC ('ALTER DATABASE REMOTEDB MODIFY FILEGROUP ftfg_REMOTEDB NAME=ftfg_REMOTEDB') at [REMOTESERVER]
This query works once I add sysadmin right to the user but without the right, it give the following error:
The server principal "USERWITHOUTSYSADMIN" is not able to access the database "REMOTEDB" under the current security context.
I am on SQL Serve 2008.
Please Help!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经过大量研究:这是不可能的:(
After much research: This is not possible:(
将 EXEC 命令放入存储过程中,并将该过程的执行权限授予用户。它不会阻止系统管理员执行它,但它也将允许其他人执行它。对此要非常非常小心!
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!
您能否允许用户冒充具有适当权限的某人?
Can you allow the user to impersonate someone with the appropriate permissions?