;with cte as 
(
select row_number() over (partition by DaysOfWeek, Channel, ResourceQuotaLink order by resourcequotaid ) as rn, * 
from [AKUZ].[T_RESOURCE_QUOTA] 
)
delete from cte where rn > 1

if not exists
(
	select * from sys.indexes i 
	where i.[object_id] = OBJECT_ID('AKUZ.T_RESOURCE_QUOTA', 'U')
	and i.[name] = 'UQ_T_RESOURCE_QUOTA_ResourceSchedule'
)
	CREATE UNIQUE INDEX UQ_T_RESOURCE_QUOTA_ResourceSchedule ON AKUZ.T_RESOURCE_QUOTA(ResourceQuotaLink, DaysOfWeek, Channel);