Use the following function
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION dbo.fn_GetCharacter
(
@SNo INT
)
RETURNS NVARCHAR(MAX)
AS
BEGIN
DECLARE @Divident INT = @SNo
DECLARE @Character NVARCHAR(MAX)=''
DECLARE @Modulo INT
WHILE(@Divident > 0)
BEGIN
SET @Modulo = (@Divident - 1) % 26;
SET @Character = CHAR(65 + @Modulo) + @Character
SET @Divident = ((@Divident - @Modulo) / 26);
END
RETURN @Character
END
GO
Now Create your table:
CREATE TABLE dbo.tbl_myTable
(
[SNo] INT IDENTITY(1,1)
,[Character] NVARCHAR(MAX)
)
Now insert like this:
INSERT tbl_myTable DEFAULT VALUES
UPDATE tbl_myTable SET [CHARACTER] = dbo.fn_GetCharacter(SCOPE_IDENTITY())
WHERE SNo = SCOPE_IDENTITY()