Answer the question
In order to leave comments, you need to log in
How to convert from varchar to real in MSSQL?
Good afternoon!
There is a line:
declare @point varchar (100) = '-27,452;26,491;4,299'
declare @index int
declare @x real
select @index = CHARINDEX(';', @point)
select @x = cast(substring(@point, 0, @index) as real);
Сообщение 8114, уровень 16, состояние 5, строка 41
Ошибка при преобразовании типа данных varchar к real.
select @x = convert(real, substring(@point, 0, @index));
select @x = convert(real, replace(substring(@point, 0, @index), ',', '.'));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question