SET QUOTED_IDENTIFIER ON
SET ANSI_NULLS ON
GO

ALTER FUNCTION [dbo].[_Brk_Tml_HaritaIl]
(
    @Text NVARCHAR(MAX)
)
RETURNS NVARCHAR(MAX)
AS
BEGIN

    DECLARE @Deger NVARCHAR(MAX);
    DECLARE @TMP NVARCHAR(MAX);

    SET @TMP = REPLACE(RTRIM(@Text) COLLATE Latin1_General_BIN, CHAR(208), N'ð');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(220), N'ü');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(222), N'þ');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(221), N'i');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(214), N'ö');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(199), N'ç');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(73), N'ý');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(240), N'ð');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(252), N'ü');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(254), N'þ');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(105), N'i');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(246), N'ö');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(231), N'ç');
    SET @TMP = REPLACE(@TMP COLLATE Latin1_General_BIN, CHAR(253), N'ý');

    SET @Text = @TMP;
    SET @Deger = UPPER(LEFT(@Text, 1));
    SET @Deger = @Deger + LOWER(RIGHT(@Text, LEN(@Text) - 1));

    RETURN @Deger;
END;









GO

