How to use an integer pivot in SQL Server?
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';