I think you need an UNPIVOT –
SELECT OrgID, Property, DataValue
FROM (SELECT OrgID, Property, DataValue
FROM YOUR_TABLE
UNPIVOT
(
DataValue FOR Property IN (ExtensionDigits
,StartExtension
,LastUsedExtension
,Server1IP
,Server2IP
,ServerPort
,IsFunctionOn
,VolumeDecibel)
) unpvt) temp
WHERE DataValue IS NOT NULL;
1
solved Pivot selected columns into rows with SQL Server [closed]