Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.
CREATE PROCEDURE ermPivotAdditionalDetails AS DECLARE @columns VARCHAR(8000) DECLARE @query VARCHAR(8000) SELECT @columns = COALESCE ( @columns + ',[' + cast(title as varchar) + ']', '[' + cast(title as varchar) + ']' ) FROM ermMapping GROUP BY title SET @query = 'SELECT * FROM (SELECT ed.appId, af.errId, custId, title, value FROM ermAdditionalFields af, ermMapping, ermErrorDetails ed WHERE fieldId = mapId and af.errId = ed.errId) piv PIVOT (max(value) FOR title in (' + @columns + ') ) as chld' EXECUTE(@query);
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.