UPDATE yourtable
SET UPC =
, CASE WHEN product_modelnumber LIKE '% %'
THEN SUBSTRING(product_modelnumber, CHARINDEX(' ', product_modelnumber) + 1, LEN(product_modelnumber) ) + ' ' + SUBSTRING(product_modelnumber, 1, CHARINDEX(' ', product_modelnumber) - 1)
ELSE product_modelnumber END
where product_ean <> 1 or product_ean is null
|