I'm running a sql code to format the data from txt to decimal. the code I wrote work well but slow
remove . replace , with . flag empty rows as NULL convert NUll in 0
this looks to run 5 times instead of 1
UPDATE PL01_SHIPMENT SET [Shipment Net Profit By Chargeable Wight] = REPLACE([Shipment Net Profit By Chargeable Wight], '.', '')
UPDATE PL01_SHIPMENT SET [Shipment Net Profit By Chargeable Wight] = REPLACE([Shipment Net Profit By Chargeable Wight], ',', '.')
UPDATE PL01_SHIPMENT SET [Shipment Net Profit By Chargeable Wight] = REPLACE([Shipment Net Profit By Chargeable Wight], 'zl', '')
UPDATE PL01_SHIPMENT SET [Shipment Net Profit By Chargeable Wight] = NULLIF([Shipment Net Profit By Chargeable Wight], '')
UPDATE PL01_SHIPMENT SET [Shipment Net Profit By Chargeable Wight] = ISNULL([Shipment Net Profit By Chargeable Wight],0)
ALTER Table dbo.PL01_SHIPMENT
ALTER COLUMN [Shipment Net Profit By Chargeable Wight] DECIMAL(18,2) NULL
GO
it is possible to write some steps in 1 line so is not querying 5 time?
this is how the data are stored enter image description here
some rows are empty that why I was thinking about NULL