UPDATE VehicleTripEntry
SET Vehicleno =
(
CASE WHEN Vehicleno LIKE '%[^a-zA-Z0-9]%' THEN Replace(REPLACE( Vehicleno, SUBSTRING( Vehicleno, PATINDEX('%[~,@,#,$,%,&,*,^,&,%,*,(,), ,`]%', Vehicleno), 1 ),''),'-','')
ELSE Vehicleno
END
)
where VehicleType = 'H'
SET Vehicleno =
(
CASE WHEN Vehicleno LIKE '%[^a-zA-Z0-9]%' THEN Replace(REPLACE( Vehicleno, SUBSTRING( Vehicleno, PATINDEX('%[~,@,#,$,%,&,*,^,&,%,*,(,), ,`]%', Vehicleno), 1 ),''),'-','')
ELSE Vehicleno
END
)
where VehicleType = 'H'
No comments:
Post a Comment