I have a table Users, so some rows specially in field Full Name are in different upper/lower case, so i found this function:
CREATE function properCase(@texto varchar(8000)) returns varchar(8000) as
begin
--declare @texto = 'hola'
set @texto = lower(@texto)
declare @i int
set @i = ascii('a')
while @i <= ascii('z')
begin
set @texto = replace(@texto, ' ' + char(@i), ' ' + char(@i-32))
set @i = @i + 1
end
set @texto = char(ascii(left(@texto, 1))-32) + right(@texto, len(@texto)-1)
return @texto
end
How can I use this function to update or select the "fullname" field from my user table?