Решение:
DECLARE @input VARCHAR(11) = '2323' select CAST(CASE WHEN @input NOT LIKE '%[^0-9]%' THEN @input END AS INT) DECLARE @input2 VARCHAR(11) = '23.23' select CAST(CASE WHEN @input2 NOT LIKE '%[^0-9.]%' THEN @input2 END AS float)
Решение:
DECLARE @input VARCHAR(11) = '2323' select CAST(CASE WHEN @input NOT LIKE '%[^0-9]%' THEN @input END AS INT) DECLARE @input2 VARCHAR(11) = '23.23' select CAST(CASE WHEN @input2 NOT LIKE '%[^0-9.]%' THEN @input2 END AS float)