通过界面操作:在登录属性对话框->用户映射->选择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