/*
*/
BEGIN TRANSACTION; 
SET XACT_ABORT ON;
SET NOCOUNT ON;

USE tempdb;
GO
/*============================================================================= 

MDPROD-36

Support procedure used to add the AD groups logins, users and needed grants in the int, dev, prod and log databases

This procedure will take the following parameters
    1. The AD login to create in the form "domain\group"
    2. A boolean expressing if we are running in debug mode.
        The Debug mode output every impactful queries sent to the db in separate SELECT statements
        
        !!! no action is taken when debug mode is active !!!

The procedure steps are
    1. extract from the login the environment, database name and read / write permissions
    2. Check that the login environment matches the current server
    3. check that the relevant database is found on this server.
        If the database is not found on the server, the login is not created and the procedure exits.
        !!! If the database in the group name is "diverse", we still create the login but do nothing on the databases level.
    4. Create the login on the server level if it does not already exists
    5. Create the user on the database level if it does not already exists
    6. Add the login to db_datareader if the login have read permissions
    7. Add the login to db_datawriter if the login have write permissions
    8. Grant the EXECUTE permissions on all proc of the database
    9. Special case:
        If we are working on the redApp db and the login has write permissions, we also add the RECEIVE grant on the queues OrderTickerQueue and TaskTicketQueue

14.01.2025, TSC, Creation

=============================================================================*/ 
CREATE OR ALTER PROCEDURE tsc_createGroups
    @login NVARCHAR(MAX)
    ,@debug BIT = 0
AS 
BEGIN 
    --DECLARE @login NVARCHAR(MAX);
    DECLARE @login_work NVARCHAR(MAX);
    DECLARE @login_perms NVARCHAR(10);
    DECLARE @login_db NVARCHAR(255);
    DECLARE @login_env NCHAR(1);
    DECLARE @query NVARCHAR(MAX);
    DECLARE @tplLogin NVARCHAR(MAX);
    DECLARE @tplUser NVARCHAR(MAX);
    DECLARE @tplPerms NVARCHAR(MAX);
    DECLARE @tplExec NVARCHAR(MAX);
    DECLARE @tplRedappQueue NVARCHAR(MAX);
    DECLARE @tplCheckUser NVARCHAR(MAX);
    DECLARE @isEnvOk BIT = 0;
    DECLARE @role NVARCHAR(255);
    DECLARE @execute BIT = 1;
    DECLARE @loginOnly BIT = 0;
    DECLARE @userExists INT = -10;

    SET @tplLogin='
CREATE LOGIN [@login@] FROM WINDOWS;
';
    SET @tplUser='
USE @db@;
CREATE USER [@login@] FOR LOGIN [@login@];
';
    SET @tplPerms='
USE @db@;
ALTER ROLE @role@ ADD MEMBER [@login@]
';
    SET @tplExec='
USE @db@;
GRANT EXECUTE TO [@login@]
';

    SET @tplRedappQueue='
USE @db@;
GRANT RECEIVE ON OrderTickerQueue TO [@login@];
GRANT RECEIVE ON TaskTicketQueue TO [@login@];
';

    SET @tplCheckUser='
USE @db@;
SELECT @userExists = 99
FROM [sys].[database_principals] dp
WHERE [dp].[name] = ''@login@''
';

    --#region determine environment, rights and db from group name
    SET @login_work = REPLACE(@login,'centralinfra\L-CI-AP-SQL-','');
    SET @login_env = LEFT(@login_work,1);
    SET @login_work = SUBSTRING(@login_work,7,99);
    SET @login_perms = REPLACE(RIGHT(@login_work, 2), '_','');
    SET @login_work = REPLACE(@login_work,'_'+@login_perms,'');
    SET @login_db = SUBSTRING(@login_work, 0, LEN(@login_work) - CHARINDEX(REVERSE(@login_work),'_',0)+1);
    --#endregion determine environment, rights and db from group name

    PRINT REPLICATE('-',80);
    PRINT '---- Processing '+@login;
    PRINT REPLICATE('-',80);

    PRINT 'db          : '+ISNULL(CONVERT(VARCHAR(200),@login_db),'NULL')+'
environment : '+ISNULL(CONVERT(VARCHAR(200),@login_env),'NULL')+'
permissions : '+ISNULL(CONVERT(VARCHAR(200),@login_perms),'NULL')+'

';

    --#region Check we are on the correct environment for this login
    SET @isEnvOk = 0;
    IF @login_env = 'D' AND @@SERVERNAME='SWMDATASQLDEV01'
        SET @isEnvOk = 1;
    IF @login_env = 'I' AND @@SERVERNAME='SWMDATASQLINT01'
        SET @isEnvOk = 1;
    IF @login_env = 'P' AND @@SERVERNAME='SWMDATASQLPRD01'
        SET @isEnvOk = 1;
    IF @login_env = 'P' AND @@SERVERNAME='SWSQLMDQAS05' --logDB
        SET @isEnvOk = 1;
    --#endregion Check we are on the correct environment for this login

    IF @isEnvOk = 0
    BEGIN
        PRINT 'Incorrect environment. Skipping this login.';
        SET @execute = 0;
    END

    --#region check if the target db is present on this server
    IF @isEnvOk = 1 AND NOT EXISTS (
        SELECT 1
        FROM [sys].[databases] d
        WHERE [d].[name]=@login_db
    )
    BEGIN
        --exception for a login "diverse"
        IF @login_db IN ('diverse','sysadmins') AND @isEnvOk = 1
        BEGIN
            SET @loginOnly = 1;
            SET @execute = 1;
            PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Special condition, login for the group "diverse" and "sysadmins". Those logins are created even if db not found.';
        END
        ELSE
        BEGIN
            PRINT 'Database '+@login_db+' not found on this server. Skipping this login.';
            SET @execute = 0;
        END
    END
    --#endregion check if the target db is present on this server

    IF @execute = 1 OR @loginOnly = 1
    BEGIN
        --#region create login
        IF NOT EXISTS(
            SELECT 1
            FROM [sys].[server_principals] sp
            WHERE sp.[name] = @login
        )
        BEGIN
            SET @query = REPLACE(@tplLogin,'@login@', @login);
            IF @debug = 0
            BEGIN
                EXECUTE [sys].[sp_executesql] 
                    @query
                    ,N''
                    ;
            END
            ELSE
                SELECT 'Create login' AS [description], @query AS [query];
            PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - login created';
        END

        IF @login_db = 'sysadmins'
        BEGIN
            SET @query=REPLACE('ALTER SERVER ROLE [sysadmin] ADD MEMBER [@login@]', '@login@', @login);
            IF @debug = 0
                EXECUTE [sys].[sp_executesql] 
                    @query
                    ,N''
                    ;
            ELSE 
                SELECT 'Grant sysadmin' AS [description], @query AS [query];
        END
        --#endregion create login

        IF EXISTS(
            SELECT 1
            FROM [sys].[databases] d
            WHERE [d].[name]=@login_db
            AND d.[is_read_only] = 0
            AND d.[source_database_id] IS NULL --not a snapshot
        )
        BEGIN 
            --#region Create db user
            SET @query = REPLACE(
                            REPLACE(@tplCheckUser, '@db@', @login_db)
                            ,'@login@'
                            , @login
                        );
            EXEC [sys].[sp_executesql]
                @query
                ,N'@userExists INT OUTPUT'
                , @userExists OUTPUT
                ;
            -- -10 is the default (not set) value. if a user did exists, the previous dynamic sql would have assigned the value 99
            IF @userExists = -10
            BEGIN
                --Add missing user
                SELECT @query = REPLACE(
                                    REPLACE(@tplUser, '@db@', @login_db)
                                    ,'@login@'
                                    ,@login
                                );
                IF @debug = 0
                BEGIN
                    EXECUTE [sys].[sp_executesql]
                        @query
                        ,N''
                        ;
                END
                ELSE
                    SELECT 'Create user' AS [description], @query AS [query];
                PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - created missing user in '+@login_db;
            END 
            --#endregion Create db user

            --#region check to give datareader
            IF @login_perms LIKE '%R%' 
            AND EXISTS(
                SELECT 1
                FROM [sys].[databases] d
                WHERE [d].[name]=@login_db
                AND d.[is_read_only] = 0
                AND d.[source_database_id] IS NULL --not a snapshot
            )
            BEGIN
                SET @role = 'db_datareader';
                SET @query = REPLACE(
                                REPLACE(
                                    REPLACE(@tplPerms,'@db@', @login_db)
                                    ,'@login@'
                                    ,@login
                                )
                                ,'@role@'
                                ,@role
                            );
                IF @debug = 0
                BEGIN 
                    EXECUTE [sys].[sp_executesql]
                        @query
                        ,N''
                        ;
                END 
                ELSE 
                    SELECT 'grant db_datareader' AS [description], @query AS [query];
                PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Added reader role in '+@login_db;
            END
            --#endregion check to give datareader

            --#region check to give datawriter
            IF @login_perms LIKE '%W%'
            AND EXISTS(
                SELECT 1
                FROM [sys].[databases] d
                WHERE [d].[name]=@login_db
                AND d.[is_read_only] = 0
                AND d.[source_database_id] IS NULL --not a snapshot
            )
            BEGIN
                SET @role = 'db_datawriter';
                SET @query = REPLACE(
                                REPLACE(
                                    REPLACE(@tplPerms,'@db@', @login_db)
                                    ,'@login@'
                                    ,@login
                                )
                                ,'@role@'
                                ,@role
                            );
                IF @debug = 0
                BEGIN 
                    EXECUTE [sys].[sp_executesql]
                        @query
                        ,N''
                        ;
                END 
                ELSE 
                    SELECT 'grant db_dataWriter' AS [description], @query AS [query];
                PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Added writer role in '+@login_db;
            END
            --#endregion check to give datawriter

            --#region grant exec
            IF EXISTS(
                SELECT 1
                FROM [sys].[databases] d
                WHERE [d].[name]=@login_db
                AND d.[is_read_only] = 0
                AND d.[source_database_id] IS NULL --not a snapshot
            )
            BEGIN
                SELECT @query = REPLACE(
                                    REPLACE(@tplExec, '@db@', @login_db)
                                    ,'@login@'
                                    ,@login
                                );
                IF @debug = 0
                BEGIN 
                    EXECUTE [sys].[sp_executesql]
                        @query
                        ,N''
                        ;
                END 
                ELSE 
                    SELECT 'grant EXECUTE' AS [description], @query AS [query];
                PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Granted EXECUTE on all procs in '+@login_db;
            END
            --#endregion grant exec

            --#region special case: L-CI-AP-SQL-P-HCI-RedApp_RW needs Receive on OrderTickerQueue and TaskTicketQueue
            IF @login_db = 'redApp' AND @login_perms LIKE '%W%'
            BEGIN
                SELECT @query = REPLACE(
                                    REPLACE(@tplRedappQueue, '@db@', @login_db)
                                    ,'@login@'
                                    ,@login
                                );
                IF @debug = 0
                BEGIN 
                    EXECUTE [sys].[sp_executesql]
                        @query
                        ,N''
                        ;
                END 
                ELSE 
                    SELECT 'grant RECEIVE on OrderTickerQueue and TaskTicketQueue in '+@login_db AS [description], @query AS [query];
                PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Granted RECEIVE on OrderTickerQueue and TaskTicketQueue in '+@login_db;
            END
            --#endregion special case: L-CI-AP-SQL-P-HCI-RedApp_RW needs Receive on OrderTickerQueue and TaskTicketQueue

            --#region special case: create user and assign read / write permissions on all DBs for login related to "diverse"
        END 

        IF @login_db = 'diverse'
        BEGIN
            CREATE TABLE #logins(
                dbName VARCHAR(255) NOT NULL
                ,principal VARCHAR(2555) NOT NULL 
            );

            /* declare variables */
            DECLARE @csrDbName VARCHAR(255);
                
            DECLARE csrAllDbs CURSOR FAST_FORWARD READ_ONLY FOR 
                SELECT [d].[name]
                FROM sys.databases d
                WHERE [d].[database_id] >4 
                AND d.[is_read_only] = 0            --ignore read only dbs
                AND d.[source_database_id] IS NULL  --ignore snapshot
                AND d.[state] = 0                   --db is online

            OPEN csrAllDbs
                
            FETCH NEXT FROM csrAllDbs INTO @csrDbName
                
            WHILE @@FETCH_STATUS = 0
            BEGIN
                --fetch a list of principals matching the new one
                TRUNCATE TABLE [#logins];
                SET @query = REPLACE('
USE @db@

INSERT INTO #logins(dbName, principal)
SELECT DB_NAME() AS dbName, [name] AS principal 
FROM [sys].[database_principals]
WHERE name LIKE ''centralinfra\L-CI-AP-SQL-_-HCI-%''
', '@db@', @csrDbName);
                EXECUTE sys.[sp_executesql]
                    @query
                    ,N''
                    ;
                --#region Add user "diverse" and permission because no login L-CP-AP... exists in target db
                IF NOT EXISTS (
                    SELECT 1 
                    FROM [#logins] s
                    WHERE s.[principal] NOT LIKE '%'+@login_db+'%'
                )
                --BEGIN
                --    PRINT 'User(s) already exists in db '+@csrDbName+'. Skipping adding login "Diverse"';
                --END
                --ELSE 
                BEGIN 
                    --Create the user in the db
                    SET @query = REPLACE(
                                    REPLACE(@tplCheckUser, '@db@', @csrDbName)
                                    ,'@login@'
                                    , @login
                                );
                    EXEC [sys].[sp_executesql]
                        @query
                        ,N'@userExists INT OUTPUT'
                        , @userExists OUTPUT
                        ;
                    -- -10 is the default (not set) value. if a user did exists, the previous dynamic sql would have assigned the value 99
                    IF @userExists = -10
                    BEGIN
                        --Add missing user
                        SELECT @query = REPLACE(
                                            REPLACE(@tplUser, '@db@', @csrDbName)
                                            ,'@login@'
                                            ,@login
                                        );
                        IF @debug = 0
                        BEGIN
                            EXECUTE [sys].[sp_executesql]
                                @query
                                ,N''
                                ;
                        END
                        ELSE
                            SELECT 'Create user "Diverse_'+@login_perms+'" in all db' AS [description], @query AS [query];
                        PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - created user "Diverse_'+@login_perms+'" in db '+@csrDbName;
                    END 

                    --give Read permission
                    IF @login_perms LIKE '%R%'
                    BEGIN 
                        SET @role = 'db_datareader';
                        SET @query = REPLACE(
                                        REPLACE(
                                            REPLACE(@tplPerms,'@db@', @csrDbName)
                                            ,'@login@'
                                            ,@login
                                        )
                                        ,'@role@'
                                        ,@role
                                    );
                        IF @debug = 0
                        BEGIN 
                            EXECUTE [sys].[sp_executesql]
                                @query
                                ,N''
                                ;
                        END 
                        ELSE 
                            SELECT 'grant db_datareader to "Diverse_'+@login_perms+'" in all dbs' AS [description], @query AS [query];
                        PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Added reader role for "Diverse_'+@login_perms+'" in '+@csrDbName;
                    END 

                    --give write permission
                    IF @login_perms LIKE '%W%'
                    BEGIN 
                        SET @role = 'db_datawriter';
                        SET @query = REPLACE(
                                        REPLACE(
                                            REPLACE(@tplPerms,'@db@', @csrDbName)
                                            ,'@login@'
                                            ,@login
                                        )
                                        ,'@role@'
                                        ,@role
                                    );
                        IF @debug = 0
                        BEGIN 
                            EXECUTE [sys].[sp_executesql]
                                @query
                                ,N''
                                ;
                        END 
                        ELSE 
                            SELECT 'grant db_datawriter to "Diverse_'+@login_perms+'" in all dbs' AS [description], @query AS [query];
                        PRINT CONVERT(VARCHAR(20), CURRENT_TIMESTAMP, 114)+' - Added writer role for "Diverse_'+@login_perms+'" in '+@csrDbName;
                    END 
                END 
                --#endregion Add user "diverse" and permission because no login L-CP-AP... exists in target db
                FETCH NEXT FROM csrAllDbs INTO @csrDbName
            END
                
            CLOSE csrAllDbs
            DEALLOCATE csrAllDbs
        END
        --#endregion special case: create user and assign read / write permissions on all DBs for login related to "diverse"
    END 
END 
GO

EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AbdaImp_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AbdaImp_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Admin_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Admin_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AggregatedLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AggregatedLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-AIPS_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-CalcGenSubst_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-CalcGenSubst_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Compendium_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Compendium_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Compendium_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-CompendiumPortal_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DataDoc_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DataDoc_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Documedis_Secured_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Documedis_Secured_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DocumedisLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DocumedisLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DocumedisPatient_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DocumedisPatient_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DocumedisUsageLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DocumedisUsageLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Dosing2Hci_FlycicleCh__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Dosing2Hci_FlycicleCh__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Dosing2Hci_FlycicleCh_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Dosing2Hci_FlycicleCh_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_Cleansing_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_Cleansing_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_Core_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_Core_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_ETL_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_ETL_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_Mart_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-DWH_Mart_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-EMediplanAppBackend_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-EMediplanAppBackend_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-FileHub_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-FileHub_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Foto__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Foto__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Foto_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-GenericTreeBrowser_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-GenericTreeBrowser_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-HciLogin_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-HciLogin_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-HciServicePortal_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-HciServicePortal_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IDMP__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IDMP__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IDMP_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IDMP_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ImportQuarantine_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ImportQuarantine_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Index__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Index__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Index_Viewer_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Index_Viewer_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IndexProduct_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IndexProduct_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IndexProduct_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-IndexProduct_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-InternationalProduct_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-InternationalProduct_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Job_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Job_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-master_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-master_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-MeddraImport_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-MeddraImport_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-MedicalData_v01r01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-MedicalData_v01r01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-msdb_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-myCatalog_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-myCatalog_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-MyProducts_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-News__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-News__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-News_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-News_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-News_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-News_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-NuGetGallery_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-NuGetGallery_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_CdsSbClearance_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_CdsSbClearance_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_Foto_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_Foto_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_JobManager_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_JobManager_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_News_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_News_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_Partner_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_Partner_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_Partner_WF_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ODB_Partner_WF_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-OgdDataImport_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-OgdDataImport_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-OID_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-OID_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Partner__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Partner__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Partner_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Partner_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-PartnerImportQuarantine_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-PartnerImportQuarantine_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-PrimaryCareAlgorithm_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-PrimaryCareAlgorithm_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Product__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Product__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Product_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Product_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ProductExternalSource_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ProductExternalSource_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-RedApp_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-RefData__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-RefData__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-RefData_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-RefData_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Reporting_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Reporting_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchData__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchData__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchData__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchData__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchEngine__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchEngine__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchEngine__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchEngine__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchEngine__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SearchEngine__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ServicePortal2_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-ServicePortal2_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2009_10_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2009_10_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2010_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2010_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2011_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2011_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2012_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2012_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2013_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2013_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2014_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_APV2014_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SL2007_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SwissIndex_Products_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SwissIndex_Products_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SwissIndex_Products_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SwissIndex_Products_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Swisspeddose_Import_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Swisspeddose_Import_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Swisspeddose_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Swisspeddose_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Swisspeddose_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Swisspeddose_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SwissRxLogin2_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-SwissRxLogin2_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Sysadmins';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2021_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2021_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2022_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2022_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2023_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2023_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2024_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-UeberpruefungBAG2024_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-WebServices_DB_Objects_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-WebServices_DB_Objects_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Wholesaler_Input_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Wholesaler_Input_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Wholesaler_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Wholesaler_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AbdaImp_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AbdaImp_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ADMIN_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ADMIN_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AggregatedLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AggregatedLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-AIPS_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Artikel_History_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Artikel_History_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Artikel_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Artikel_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-CalcFieldsViewer_XML_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-CalcFieldsViewer_XML_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-CalcGenSubst_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-CalcGenSubst_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Compendium_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Compendium_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Compendium_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-CompendiumPortal_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DataDoc_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DocumedisLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DocumedisLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DocumedisPatient_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DocumedisPatient_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DocumedisUsageLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DocumedisUsageLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Dosing2Hci_FlycicleCh__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Dosing2Hci_FlycicleCh__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Dosing2Hci_FlycicleCh_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Dosing2Hci_FlycicleCh_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_Cleansing_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_Cleansing_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_Core_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_Core_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_ETL_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_ETL_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_Mart_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-DWH_Mart_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-EMediplanAppBackend_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-EMediplanAppBackend_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-FileHub_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-FileHub_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Foto__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Foto__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Foto_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-GenericTreeBrowser_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-GenericTreeBrowser_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-HciLogin_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-HciLogin_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-HciServicePortal_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-HciServicePortal_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IDMP__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IDMP__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IDMP_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IDMP_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IDMP_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IDMP_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Index_Viewer_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IndexProduct_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-IndexProduct_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-InternationalProduct_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-InternationalProduct_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-JOB_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-JOB_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-master_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-master_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-MeddraImport_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-MeddraImport_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-MedicalData_v01r01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-MedicalData_v01r01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-msdb_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-myCatalog_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-myCatalog_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-MyProducts_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-News__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-News__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-News_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-News_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-News_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-News_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ODB_CdsSbClearance_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ODB_CdsSbClearance_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ODB_Foto_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ODB_News_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ODB_Partner_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ODB_Partner_WF_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-OgdDataImport_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-OgdDataImport_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-OID_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-OID_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Partner__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Partner__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Partner_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Partner_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Partner_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Partner_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-PartnerImportQuarantine_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-PrimaryCareAlgorithm_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-PrimaryCareAlgorithm_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Product__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Product__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Product_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Product_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ProductExternalSource_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ProductExternalSource_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RedApp_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RefData__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RefData__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RefData_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RefData_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RefData_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-RefData_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Reporting_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Reporting_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchData__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchData__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchData__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchData__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchEngine__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchEngine__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchEngine__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchEngine__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchEngine__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SearchEngine__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ServicePortal2_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-ServicePortal2_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SL2007_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SL2007_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SL2007_SUPERSET_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SL2007_SUPERSET_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SwissIndex_Products_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SwissIndex_Products_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SwissIndex_Products_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SwissIndex_Products_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Swisspeddose_Import_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Swisspeddose_Import_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Swisspeddose_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Swisspeddose_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Swisspeddose_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Swisspeddose_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SwissRxLogin2_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-SwissRxLogin2_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Sysadmins';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2021_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2021_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2022_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2022_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2023_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2023_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2024_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-UeberpruefungBAG2024_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-WebServices_DB_Objects_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Wholesaler_Input_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Wholesaler_Input_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Wholesaler_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Wholesaler_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AbdaImp_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AbdaImp_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Admin_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Admin_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AggregatedLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AggregatedLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AIPS__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AIPS__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AIPS_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-AIPS_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-APV2017_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-APV2017_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-APV2018_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-APV2018_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Artikel_History_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Artikel_History_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Artikel_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Artikel_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-CalcFieldsViewer_XML_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-CalcFieldsViewer_XML_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-CalcGenSubst_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-CalcGenSubst_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Compendium_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Compendium_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Compendium_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-CompendiumPortal_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DataDoc_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DocumedisLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DocumedisLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DocumedisPatient_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DocumedisPatient_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DocumedisUsageLogs_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DocumedisUsageLogs_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Dosing2Hci_FlycicleCh__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Dosing2Hci_FlycicleCh__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Dosing2Hci_FlycicleCh_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Dosing2Hci_FlycicleCh_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_Cleansing_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_Cleansing_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_Core_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_Core_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_ETL_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_ETL_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_Mart_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-DWH_Mart_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-FileHub_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-FileHub_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Foto__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Foto__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Foto_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-GenericTreeBrowser_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-GenericTreeBrowser_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-HciLogin_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-HciLogin_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-HciServicePortal_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-HciServicePortal_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IDMP__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IDMP__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IDMP_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IDMP_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IDMP_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IDMP_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Index_Viewer_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IndexProduct_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-IndexProduct_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-InternationalProduct_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-InternationalProduct_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-JOB_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-JOB_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-master_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-master_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MeddraImport_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MeddraImport_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MedicalData_v01r01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MedicalData_v01r01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-msdb_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MyCatalog_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MyCatalog_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-MyProducts_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-News__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-News__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-News_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-News_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-News_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-News_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_CdsSbClearance_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_CdsSbClearance_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_Foto_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_News_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_Price_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_Price_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_TxtSelection_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ODB_TxtSelection_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-OgdDataImport_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-OgdDataImport_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-OID_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-OID_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Output_Data_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Output_Data_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Partner__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Partner__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Partner_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Partner_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Partner_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Partner_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Pharmavista_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Pharmavista_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Price__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Price__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Price_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Price_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Price_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Price_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-PrimaryCareAlgorithm_Collect_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-PrimaryCareAlgorithm_Collect_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-PrimaryCareAlgorithm_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-PrimaryCareAlgorithm_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Product__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Product__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Product_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Product_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ProductExternalSource_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ProductExternalSource_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RedApp_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RefData__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RefData__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RefData_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RefData_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RefData_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RefData_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Reporting_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Reporting_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ReportingData_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ReportingData_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RFD_Abrechnung_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-RFD_Abrechnung_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchData__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchData__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchData__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchData__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchEngine__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchEngine__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchEngine__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchEngine__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchEngine__Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SearchEngine__Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ServicePortal2_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-ServicePortal2_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2009_10_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2009_10_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2010_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2010_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2011_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2011_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2012_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2012_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2013_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2013_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2014_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_APV2014_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SL2007_Superset_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SwissIndex_Products_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SwissIndex_Products_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SwissIndex_Products_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SwissIndex_Products_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Swisspeddose_Import_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Swisspeddose_Import_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Swisspeddose_Superset__00_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Swisspeddose_Superset__00_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Swisspeddose_Superset__01_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Swisspeddose_Superset__01_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SwissRxLogin2_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SwissRxLogin2_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SyncWORKS_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-SyncWORKS_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Sysadmins';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Ueberpruefung2019_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Ueberpruefung2019_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2020_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2020_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2021_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2021_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2022_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2022_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2023_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2023_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2023_Test_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2023_Test_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2024_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-UeberpruefungBAG2024_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-WebServices_Objects_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Wholesaler_Input_Work_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Wholesaler_Input_Work_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Wholesaler_Superset_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Wholesaler_Superset_RW';

--those roles are dependant of other roles created before, keep them at the end
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Diverse_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-D-HCI-Diverse_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Diverse_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-I-HCI-Diverse_RW';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Diverse_R';
EXECUTE tsc_createGroups 'centralinfra\L-CI-AP-SQL-P-HCI-Diverse_RW';


GO
IF OBJECT_ID('tempdb..tsc_createGroup') IS NOT NULL 
    DROP PROCEDURE tsc_createGroup;

ROLLBACK TRANSACTION; 
--COMMIT TRANSACTION 