Try This:
SELECT Name,
STUFF(
(SELECT ',' + CAST(P.PowerDescr as VARCHAR(MAX))
FROM fn_ParseCsvString(H1.PowerIds, ',') H2
INNER JOIN Powers P ON P.PowerId = H2.ParsedString
FOR XML path('')),1,1,''
) AS Strength
FROM Heroes H1
Function:
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE FUNCTION [dbo].[fn_ParseCsvString]
(
@csvString VARCHAR(MAX),
@delimiter VARCHAR(MAX)
)
RETURNS @parsedStringTable TABLE (ParsedString VARCHAR(MAX))
AS
BEGIN
DECLARE @startIndex INT, @targetedIndex INT
SELECT
@startIndex = 1
WHILE @startIndex <= LEN(@CSVString)
BEGIN
SELECT
@targetedIndex = charindex(@Delimiter, @CSVString, @startIndex)
IF @targetedIndex = 0
BEGIN
SELECT
@targetedIndex = len(@CSVString) + 1
END
INSERT @parsedStringTable
SELECT
SUBSTRING(@CSVString, @startIndex, @targetedIndex - @startIndex)
SELECT @startIndex = @targetedIndex + LEN(@Delimiter)
END
RETURN
END
GO
Here you can find a SQL Fiddle example.