DECLARE @temp TABLE (kolom VARCHAR(20), data VARCHAR(200) )
INSERT INTO @temp
        (kolom, data)
VALUES
        ('', -- kolom - varchar(20)
         ''  -- data - varchar(200)
         )

DECLARE @nama_tabel VARCHAR(50) = 'Peserta'
DECLARE @nama_kolom VARCHAR(20)

DECLARE list_cursor CURSOR FOR  
SELECT
  c.name
FROM
  sys.tables AS t INNER JOIN
  sys.columns AS c ON t.object_id = c.object_id
WHERE
  t.name = @nama_tabel

OPEN list_cursor  
FETCH NEXT FROM list_cursor INTO @nama_kolom  

WHILE @@FETCH_STATUS = 0  
BEGIN 

  DECLARE list_cursor CURSOR FOR  
  SELECT TOP 10	@nama_kolom FROM @nama_tabel

  --DECLARE @query VARCHAR(200)
  
  --INSERT INTO @temp
  --      (kolom, data)
  --SELECT @nama_kolom, FROM @nama_tabel
  --SET @query = 'SELECT '+@nama_kolom+' FROM '+@nama_tabel
  --EXEC(@query)

  PRINT @nama_kolom

  FETCH NEXT FROM list_cursor INTO @nama_kolom  
END  

CLOSE list_cursor  
DEALLOCATE list_cursor 