So I guess you want something like this - parse the string representing your number, adding up the individual digits as integer values. This gives you a total result at the end - then you do whatever you need to do with that. This code works for any length of string (up to 50 characters = 50 digits in your original number):
DECLARE @Number INT
SET @Number = 62
DECLARE @NumString VARCHAR(50)
SET @NumString = CAST(@Number AS VARCHAR(50))
DECLARE @Index INT
SET @Index = 1
DECLARE @Sum INT
SET @Sum = 0
WHILE @Index <= LEN(@NumString)
BEGIN
SET @Sum = @Sum + CAST(SUBSTRING(@NumString, @Index, 1) AS INT)
SET @Index = @Index + 1
END
SELECT @Sum AS 'Sum of all digits'
With the initial value of "62" for @Number, I get a result of 8 - now you can continue on using that value.
If you need this function often, I would probably encapsulate it into a user-defined function so you can call it from everywhere in your code.