If you have a know or maximum number of desired columns, you can do a simple PIVOT, otherwise, you would need to go DYNAMIC
Example
Select *
From (
Select [Code]
,[Data]
,[Col] = concat('Data',Row_Number() over (Partition By [Code] Order by 1/0))
From YourTable
) src
Pivot (max([Data]) for [Col] in ([Data1],[Data2],[Data3],[Data4],[Data5])) pvt
Returns
Code Data1 Data2 Data3 Data4 Data5
SL Payroll 22 33 43 NULL NULL