-
Notifications
You must be signed in to change notification settings - Fork 0
/
MSSQL-IIDR-Schema-Privileges
24 lines (22 loc) · 1.06 KB
/
MSSQL-IIDR-Schema-Privileges
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
declare @user sysname;
select @user = N'GSIIDR';
exec (N'use master; grant view server state to [' + @user + N']')
exec (N'use master; grant alter any linked server to [' + @user + N']')
GO
-- Only required for a trusted database
declare @user sysname;
select @user = N'gsiidr';
exec (N'use iidrtrusted; grant execute on dbo.dbccdbtable_v1 to [' + @user + N']')
exec (N'use iidrtrusted; grant execute on dbo.replicationdboption_v1 to [' + @user + N']')
exec (N'use iidrtrusted; grant execute on dbo.addpublication_v1 to [' + @user + N']')
exec (N'use iidrtrusted; grant execute on dbo.dbccloginfo_v1 to [' + @user + N']')
GO
-- Only required for a local distribution database
declare @user sysname;
select @user = N'gsiidr';
declare @distribution sysname;
select @distribution = N'distribution';
exec (N'use [' + @distribution + N']; grant select on dbo.MSpublications to [' + @user + N']')
exec (N'use [' + @distribution + N']; grant select on dbo.MSsubscriptions to [' + @user + N']')
exec (N'use [' + @distribution + N']; grant update on dbo.MSsubscriptions to [' + @user + N']')
GO