I am trying to pivot a dataset, but I keep getting an error. I wonder could someone help me.
Here is the query
drop table #tmpquestions
create table #tmpquestions (shortdesc varchar(100))
insert into #tmpquestions select shortdesc from tmpprofile
DECLARE @SQLQuestions varchar(8000)
SELECT @SQLQuestions = @SQLQuestions + '
['+ shortdesc +']'
select locationid as fklocationid,shortdesc
(select * from tmpProfile) S
Group By LocationID
I am getting an error here: FOR ShortDesc
Could someone help me solve this. I have attached the data to reproduce the error.