Consider the following data:
DECLARE @OrderString VARCHAR(MAX) = '1=1;|2=|3=|4=1;|5=|';
This data was being returned in an externally generated XML file, so out of the control of the developer.
Each element of information is delimited by a pipe |. Within each element, the first number, to the left the equal sign =, represented an Item Number. The second number, to the right of the equal sign, represented an Order Quantity. This could be any number, and if empty, it meant zero.
The developer needed to return this data in form of a table. He also needed to return only the rows with an Item Quantity greater than zero.