You can try the Following Query Which takes the Table name and Columns name Dynamaically
DECLARE @sqlCommand varchar(1000)
DECLARE @columnList varchar(75)
DECLARE @table varchar(75)
SET @columnList = 'ExceptionTime,ExceptionMessage'
SET @table = 'ExceptionLog'
SET @sqlCommand = 'SELECT ' + @columnList + ' FROM ' + @table
print(@sqlCommand)
EXEC (@sqlCommand)