I think you need a function to archive it. Here is the function which returns the string with first letter capital of each word:
CREATE FUNCTION [dbo].[ufn_Get_String_with_First_Letter_Capital_of_Each_Word] (
@inputString varchar(100),
@delimiter char(1)
)
RETURNS VARCHAR(100)
AS
BEGIN
DECLARE @outputString varchar(100) = '';
DECLARE @word varchar(100) = '';
DECLARE @pos int = 0;
DECLARE @len int = 0;
SET @inputString = CASE WHEN RIGHT(@inputString, 1) <> @delimiter THEN @inputString + @delimiter ELSE @inputString END;
WHILE CHARINDEX(@delimiter, @inputString, @pos + 1) > 0
BEGIN
SET @len = CHARINDEX(@delimiter, @inputString, @pos + 1) - @pos;
SET @word = SUBSTRING(@inputString, @pos, @len);
SET @word = UPPER(LEFT(@word, 1)) + LOWER(SUBSTRING(@word, 2, LEN(@word) - 1))
IF @pos = 0
BEGIN
SET @outputString = @word;
END
ELSE
BEGIN
SET @outputString = @outputString + ' ' + @word;
END
SET @pos = CHARINDEX(@delimiter, @inputString, @pos + @len) + 1
END
RETURN @outputString;
END
GO
And then use the following query to the result:
SELECT [dbo].[ufn_Get_String_with_First_Letter_Capital_of_Each_Word](First_lastname, ' ')
FROM main13;