From ee43767c84cbb0457a2744fddbbc9b9696f0d8a7 Mon Sep 17 00:00:00 2001 From: Rui Tome Date: Thu, 11 Jan 2024 12:15:36 +0000 Subject: [PATCH] [AC-1682] Modified AccessAllCollectionUsers script to bump revision date by each OrgUser --- ...2023-12-06_01_AccessAllCollectionUsers.sql | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/util/Migrator/DbScripts_transition/2023-12-06_01_AccessAllCollectionUsers.sql b/util/Migrator/DbScripts_transition/2023-12-06_01_AccessAllCollectionUsers.sql index 19b97a5ac..7b663d1ba 100644 --- a/util/Migrator/DbScripts_transition/2023-12-06_01_AccessAllCollectionUsers.sql +++ b/util/Migrator/DbScripts_transition/2023-12-06_01_AccessAllCollectionUsers.sql @@ -36,27 +36,27 @@ SET [AccessAll] = 0 FROM [dbo].[OrganizationUser] OU INNER JOIN #TempOrgUser T ON OU.[Id] = T.[OrganizationUserId] --- Step 5: Bump the account revision date for each unique OrganizationId in #TempOrgUser -DECLARE @OrganizationId UNIQUEIDENTIFIER +-- Step 5: Bump the account revision date for each unique OrganizationUserId in #TempOrgUser +DECLARE @OrganizationUserId UNIQUEIDENTIFIER -DECLARE OrgIdCursor CURSOR FOR -SELECT DISTINCT [OrganizationId] +DECLARE OrgUserIdCursor CURSOR FOR +SELECT DISTINCT [OrganizationUserId] FROM #TempOrgUser -OPEN OrgIdCursor -FETCH NEXT FROM OrgIdCursor INTO @OrganizationId +OPEN OrgUserIdCursor +FETCH NEXT FROM OrgUserIdCursor INTO @OrganizationUserId WHILE (@@FETCH_STATUS = 0) BEGIN - -- Execute the stored procedure for the current OrganizationId - EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationId] @OrganizationId + -- Execute the stored procedure for the current OrganizationUserId + EXEC [dbo].[User_BumpAccountRevisionDateByOrganizationUserId] @OrganizationUserId - -- Fetch the next OrganizationId - FETCH NEXT FROM OrgIdCursor INTO @OrganizationId + -- Fetch the next OrganizationUserId + FETCH NEXT FROM OrgUserIdCursor INTO @OrganizationUserId END -CLOSE OrgIdCursor -DEALLOCATE OrgIdCursor; +CLOSE OrgUserIdCursor +DEALLOCATE OrgUserIdCursor; -- Step 6: Drop the temporary table DROP TABLE #TempOrgUser;