johnsonlim026
November 5th, 2006, 09:04 PM
I faced the problem where the SQL server fail to concatenate two integer but instead sum up the two integer.My code is as below:
WHILE @counter<=len('@Wh125-Loc1')
BEGIN
if (substring('@Wh125-Loc1',@counter,1)='-' )
BEGIN
set @result='10'
BREAK
END
ELSE
if (isnumeric(substring('@Wh125-Loc1',@counter,1)))=1
BEGIN
set @num= substring('@Wh125-Loc1',@counter,1)
set @num2=@num2+@num
print @num2
END
set @counter=@counter +1
END
Can some one give me an idea on doing this?
WHILE @counter<=len('@Wh125-Loc1')
BEGIN
if (substring('@Wh125-Loc1',@counter,1)='-' )
BEGIN
set @result='10'
BREAK
END
ELSE
if (isnumeric(substring('@Wh125-Loc1',@counter,1)))=1
BEGIN
set @num= substring('@Wh125-Loc1',@counter,1)
set @num2=@num2+@num
print @num2
END
set @counter=@counter +1
END
Can some one give me an idea on doing this?