USE ManageSoft
GO

DECLARE @GroupID INT

DECLARE c CURSOR FOR
SELECT GroupID FROM [Group] WHERE GroupCN = 'MGS Administrators'

OPEN c
FETCH NEXT FROM c INTO @GroupID
WHILE @@FETCH_STATUS = 0
BEGIN
	EXEC RightSetAdminRightsByGroupID @GroupID
	FETCH NEXT FROM c INTO @GroupID
END
CLOSE c
DEALLOCATE c

GO


DECLARE @GroupID INT

DECLARE c CURSOR FOR
SELECT GroupID FROM [Group] WHERE GroupCN = 'MGS Report Users'

OPEN c
FETCH NEXT FROM c INTO @GroupID
WHILE @@FETCH_STATUS = 0
BEGIN
	EXEC RightSetReportRightsByGroupID @GroupID
	FETCH NEXT FROM c INTO @GroupID
END
CLOSE c
DEALLOCATE c
GO
