Stored Procedures [dbo].[ujo_bump_digit0]
Properties
PropertyValue
ANSI Nulls OnYes
Quoted Identifier OnYes
Parameters
NameData TypeMax Length (Bytes)Direction
@i_odigitvarchar(13)13
@resultvarchar1Out
@did_rollint4Out
Permissions
TypeActionOwning Principal
GrantExecuteujoadmin
SQL Script
create proc ujo_bump_digit0 @i_odigit VARCHAR(13), @result VARCHAR(1) output, @did_roll int output
as
    declare @new_val int,
            @orig_val int           
    
    
    set @did_roll = 0
    set @orig_val = ASCII(@i_odigit)    
    IF @orig_val = 57
    begin
            /* go from '9' to 'a'*/
            set @new_val = 97
    end
    else IF @orig_val = 117  
    begin
            /* go from 'u' to '0'*/
            set @new_val = 48
            set @did_roll = 1            
    end
    else
    begin            
            set @new_val = @orig_val + 1
    end

   set @result = CHAR(@new_val)
GO
GRANT EXECUTE ON  [dbo].[ujo_bump_digit0] TO [ujoadmin]
GO
Uses
Used By