How to use an integer pivot in SQL Server? I want to get multiples rows using a pivot:

FIXED  |    0    1    2    3    4
---- ---- ---- ---- ---- ---- ----
First  |    D1   C1   SP   A0   1B


I did it:

DECLARE @zero int = 0
DECLARE @one int = 1
DEClARE @two int = 2
DECLARE @three int = 3
DECLARe @four int = 4
DECLARE @col NVARCHAR(MAX) = '[' + CONVERT(varchar(MAX), @zero) + '], [' + CONVERT(varchar(MAX), @one) + '], [' + CONVERT(varchar(MAX), @two) + '], [' + CONVERT(varchar(MAX), @three) + '], [' + CONVERT(varchar(MAX), @four) + ']'
DECLARE @sql NVARCHAR(MAX)

 SET @sql = 'SELECT * FROM 
            (
                SELECT Principal.Fixed, Code.Alpha, Code.Position                
                FROM       Principal
                INNER JOIN Code ON Principal.Id = Code.PrincipalId
            ) SOURCE
            PIVOT 
            ( 
                MAX(SOURCE.Alpha) 
                FOR SOURCE.Position in ('+@col+')
            ) PIVOTABLE'

EXEC sp_executesql @sql


And the output always is NULL:

FIXED  |    0    1    2    3    4
---- ---- ---- ---- ---- ---- ----
First  |   NULL NULL NULL NULL NULL


What did I do wrong?
First I'd suggest to verify that you source query returns expected data:

SELECT     Principal.Fixed, Code.Alpha, Code.Position                
FROM       Principal
INNER JOIN Code ON Principal.Id;


I've set up a single test and it should works. (dbfiddle here)

Second, you can build @col variable dynamically by using Position values returned by your main query, avoiding to build it using variables (@one, @two, ...)

DECLARE @col AS nvarchar(MAX),
        @cmd AS nvarchar(MAX);

SET @col = STUFF((SELECT distinct ',' + QUOTENAME(Code.Position) 
                  FROM Principal
                  INNER JOIN Code ON Principal.Id = Code.PrincipalId
            FOR XML PATH(''), TYPE
            ).value('.', 'nvarchar(MAX)') 
           ,1,1,'')

SET @cmd =   'SELECT Fixed, ' + @col
           + ' FROM'  
           + ' (SELECT Principal.Fixed, Code.Alpha, Code.Position '                
           + '  FROM       Principal '
           + '  INNER JOIN Code ON Principal.Id = Code.PrincipalId) src'
           + ' PIVOT (MAX(Alpha) FOR Position IN (' + @col + ')) pvt';