Please try the following solution.
It shows power of XQuery and FLWOR expression.
Number of columns could be flexible, i.e. anything but column ID.
SQL
-- DDL and sample data population, start
DECLARE @tbl TABLE (ID Int, A_10 INT, A_11 INT, A_12 INT, B_10 INT, B_11 INT, B_12 INT);
INSERT INTO @tbl VALUES
( 1234,NULL,NULL,NULL,NULL,NULL,NULL),
( 5678,NULL,NULL,0,NULL,1,1),
( 9012,NULL,0,NULL,NULL,NULL,0),
( 8956,NULL,1,NULL,1,0,1);
-- DDL and sample data population, end
SELECT ID
, REPLACE((SELECT (
SELECT *
FROM @tbl AS c
WHERE c.ID = p.id
FOR XML PATH('r'), TYPE, ROOT('root')).query('
for $x in /root/r/*[local-name(.)!="ID" and ./text() = "1"]
return local-name($x)
').value('.','VARCHAR(MAX)')),SPACE(1),',') AS column_list
FROM @tbl AS p;
Output
+------+----------------+
| ID | column_list |
+------+----------------+
| 1234 | |
| 5678 | B_11,B_12 |
| 9012 | |
| 8956 | A_11,B_10,B_12 |
+------+----------------+