First off, use this splitter function: http://www.sqlservercentral.com/articles/Tally+Table/72993/e.g. with cte(mytext) as ( select * from (values ('0535 Golds Gym Westport'), ('0548 Nautilus Fitness of Sherman'), ('0704 Xtreme Family Fitness'), ('0732 Blue Springs Fitness') ) v(t))select mytext, split.*from ctecross apply [Loyalty].[DelimitedSplit8K](mytext, ' ') split
yields:mytext ItemNumber Item0535 Golds Gym Westport 1 05350535 Golds Gym Westport 2 Golds0535 Golds Gym Westport 3 Gym0535 Golds Gym Westport 4 Westport0548 Nautilus Fitness of Sherman 1 05480548 Nautilus Fitness of Sherman 2 Nautilus0548 Nautilus Fitness of Sherman 3 Fitness0548 Nautilus Fitness of Sherman 4 of0548 Nautilus Fitness of Sherman 5 Sherman0704 Xtreme Family Fitness 1 07040704 Xtreme Family Fitness 2 Xtreme0704 Xtreme Family Fitness 3 Family0704 Xtreme Family Fitness 4 Fitness0732 Blue Springs Fitness 1 07320732 Blue Springs Fitness 2 Blue0732 Blue Springs Fitness 3 Springs0732 Blue Springs Fitness 4 Fitness
With this, you can work on it token by token. The next step could be:...select mytext, split.*from ctecross apply [Loyalty].[DelimitedSplit8K](mytext, ' ') splitwhere split.Item NOT LIKE '%[^0-9]%'
which gets to:mytext ItemNumber Item0535 Golds Gym Westport 1 05350548 Nautilus Fitness of Sherman 1 05480704 Xtreme Family Fitness 1 07040732 Blue Springs Fitness 1 0732
which picks out the numbers from the tokenized string. Then you can do what you want with the numbers