The core infrastructure backend (API, database, Docker, etc).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

14 lines
390 B

-- Enable UseMyItems for all organizations with UsePolicies enabled
-- Batch to avoid table locks
DECLARE @BatchSize INT = 1000;
DECLARE @RowsAffected INT = 1;
WHILE @RowsAffected > 0
BEGIN
UPDATE TOP (@BatchSize) [dbo].[Organization]
SET [UseMyItems] = 1
WHERE [UsePolicies] = 1
AND [UseMyItems] = 0;
SET @RowsAffected = @@ROWCOUNT;
END