Reputation: 91895
Our database has a named database role. Our service account is a member of this role. This makes our database creation scripts simpler.
However, I'd like this role to be able to create linked servers.
If I try the following:
USE OurDatabase
GO
GRANT ALTER ANY LINKED SERVER TO OurRole
GO
...it fails with Permissions at the server scope can only be granted when the current database is master
.
If I try the opposite:
USE [master]
GO
GRANT ALTER ANY LINKED SERVER TO OurRole
GO
...then it fails with Cannot find the login 'OurRole', because it does not exist or you do not have permission.
How do I grant linked server permissions to a database role in SQL Server?
Upvotes: 1
Views: 6984
Reputation: 441
The documentation would suggest that granting a server permission to a database role is not possible (compare to the documentation for granting a database permission).
Upvotes: 3