I have a table like this...
CustomerID DBColumnName Data
--------------------------------------
1 FirstName Joe
1 MiddleName
SELECT
main.CustomerID,
f.Data AS FirstName,
m.Data AS MiddleName,
l.Data AS LastName,
d.Data AS Date
FROM table main
INNER JOIN table f on f.CustomerID = main.CustomerID
INNER JOIN table m on m.CustomerID = main.CustomerID
INNER JOIN table l on l.CustomerID = main.CustomerID
INNER JOIN table d on d.CustomerID = main.CustomerID
WHERE f.DBColumnName = 'FirstName'
AND m.DBColumnName = 'MiddleName'
AND l.DBColumnName = 'LastName'
AND d.DBColumnName = 'Date'
Edit: I have written this without an editor & have not run the SQL. I hope, you get the idea.
The OP didn't actually need to pivot without agregation but for those of you coming here to know how see:
sql parameterised cte query
The answer to that question involves a situation where pivot without aggregation is needed so an example of doing it is part of the solution.
This should work:
select * from (select [CustomerID] ,[Demographic] ,[Data]
from [dbo].[pivot]
) as Ter
pivot (max(Data) for Demographic in (FirstName, MiddleName, LastName, [Date]))as bro