**Scenario**: 

1. select records from one TableA
2. loop through the table values
3. delete from another table (TableB) based on each record's value

**Sample**:

```
DECLARE @CustomerList TABLE (CustomerID bigint) 
INSERT INTO @CustomerList SELECT CustomerID FROM TableA WHERE CustomerID = @ParameterID

WHILE (SELECT COUNT(*) FROM @CustomerList) > 0
BEGIN
DELETE FROM [TableB]
WHERE [CustomerID] = @CustomerList.CustomerID -- challenge
END

```

**Challenge**:

* Passing the CustomerID value of each loop

**Update**

* The reason for wanting to use a loop is that there are multiple delete statements to be executed