[MSSQL] 授權-SQL Server Agent Job

參考資料: http://technet.microsoft.com/zh-tw/library/ms188283.aspx

USE [master] 

GO
CREATE LOGIN [STC\SQLAgentOperatorRole] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[繁體中文]
GO
USE [msdb]
GO
CREATE USER [STC\SQLAgentOperatorRole] FOR LOGIN [STC\SQLAgentOperatorRole]
GO
exec sp_addrolemember @rolename='SQLAgentOperatorRole', @membername='STC\SQLAgentOperatorRole'
go

USE [master]
GO
CREATE LOGIN [STC\SQLAgentReaderRole] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[繁體中文]
GO
USE [msdb]
GO
CREATE USER [STC\SQLAgentReaderRole] FOR LOGIN [STC\SQLAgentReaderRole]
GO
exec sp_addrolemember @rolename='SQLAgentReaderRole', @membername='STC\SQLAgentReaderRole'
go

USE [master]
GO
CREATE LOGIN [STC\SQLAgentUserRole] FROM WINDOWS WITH DEFAULT_DATABASE=[master], DEFAULT_LANGUAGE=[繁體中文]
GO
USE [msdb]
GO
CREATE USER [STC\SQLAgentUserRole] FOR LOGIN [STC\SQLAgentUserRole]
GO
exec sp_addrolemember @rolename='SQLAgentUserRole', @membername='STC\SQLAgentUserRole'
go

標籤: ,

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s


%d 位部落客按了讚: