授于某个用户有写作业和调度作业的权限

通过界面操作:在登录属性对话框->用户映射->选择msdb数据库->数据库角色成员身份
把dbo,SQLAgentOperatorRole,SQLAgentReadRole,SQLAgentUserRole都选上
通过代码操作:

USE [msdb]
GO
CREATE USER [user1] FOR LOGIN [user1]
GO
USE [msdb]
GO
ALTER USER [user1] WITH DEFAULT_SCHEMA=[dbo]
GO
USE [msdb]
GO
ALTER ROLE [ServerGroupReaderRole] ADD MEMBER [user1]
GO
USE [msdb]
GO
ALTER ROLE [SQLAgentOperatorRole] ADD MEMBER [user1]
GO
USE [msdb]
GO
ALTER ROLE [SQLAgentReaderRole] ADD MEMBER [user1]
GO

 

posted @ 2019-06-05 14:36  davidhou  阅读(207)  评论(0编辑  收藏  举报