This code show to use INITCAP function is SQL server
CREATE function INITCAP (@inString varchar(4000) ) returns varchar(4000) as BEGIN DECLARE @i int, @c char(1),@result varchar(255) SET @result=LOWER(@inString) SET @i=2 SET @result=STUFF(@result,1,1,UPPER(SUBSTRING(@inString,1,1))) WHILE @i<=LEN(@inString) BEGIN SET @c=SUBSTRING(@inString,@i,1) IF (@c=' ') OR (@c=';') OR (@c=':') OR (@c='!') OR (@c='?') OR (@c=',')OR (@c='.')OR (@c='_') IF @i<'LEN(@inString) BEGIN SET @i=@i+1 SET @result=STUFF(@result,@i,1,UPPER(SUBSTRING(@inString,@i,1))) END SET @i=@i+1 END RETURN @result END
|
No responses found. Be the first to respond and make money from revenue sharing program.
|