DECLARE @SourcesToDelete TABLE
(
	ID int,
	[SourceName] NVARCHAR(MAX)
)

-- TODO:  Add Device names here.
INSERT INTO @SourcesToDelete
VALUES
(1,N'SS5_SG352.B304')
,(2,N'SS5_SG352.B305')
,(3,N'SS5_SG352.B306')
,(4,N'SS5_SG352.B307')
,(5,N'SS5_SG352.B308')
,(6,N'SS5_SG352.B309')
,(7,N'SS5_SG352.B310')
,(8,N'SS5_SG352.B313')
,(9,N'SS5_SG352_INC1.B301')
,(10,N'SS5_SG352_INC2.B302')
,(11,N'SWRO_SG002_LV.INC1')
,(12,N'SWRO_SG002_LV.INC2')
,(13,N'SWRO_SG206_MV.INC1')
,(14,N'SWRO_SG206_MV.INC2')
,(15,N'SWRO_SG207_MV.INC1')
,(16,N'SWRO_SG207_MV.INC2')
,(17,N'WWTP_SG003_LV.INC1')
,(18,N'WWTP_SG003_LV.INC2')

DECLARE	
@Count int = (select Count (*) FROM @SourcesToDelete),
@IDSource int,
@SourceDelete NVARCHAR(MAX)


while @Count > 0

Begin

Select @IDSource = ID, @SourceDelete = [SourceName] from  @SourcesToDelete
ORDER BY ID DESC OFFSET @Count - 1 ROWS FETCH NEXT 1 ROWS ONLY;

EXEC [ION_Data].[dbo].[spDM_DeleteSourceAndBatchDeleteData]
	@SourceSystemName =@SourceDelete

	Set @Count =  @Count - 1
END