如何在没有 SYSADMIN 权限的情况下更改链接服务器上的数据库?

发布于 2024-09-18 23:23:09 字数 502 浏览 3 评论 0原文

我的要求是执行更改的用户不能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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

简单爱 2024-09-25 23:23:09

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

After much research: This is not possible:(

月亮坠入山谷 2024-09-25 23:23:09

将 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!

流年里的时光 2024-09-25 23:23:09

您能否允许用户冒充具有适当权限的某人?

EXEC ('ALTER DATABASE REMOTEDB MODIFY FILEGROUP ftfg_REMOTEDB NAME=ftfg_REMOTEDB') 
    AS USER = 'UserWithAppropriatePermissions'
    AT [REMOTESERVER]

Can you allow the user to impersonate someone with the appropriate permissions?

EXEC ('ALTER DATABASE REMOTEDB MODIFY FILEGROUP ftfg_REMOTEDB NAME=ftfg_REMOTEDB') 
    AS USER = 'UserWithAppropriatePermissions'
    AT [REMOTESERVER]
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文