prabhu p

prabhu p

  • NA
  • 181
  • 114.4k

How to change order of variable that contains array of dat

Feb 5 2016 10:54 AM
Iam writing stored procedure in that iam using pivot for columns and assign columns to variable
@sqlquery1 = jan2015,feb2015,march2015
@sqlquery2 = jan-Transferdate,feb-transferdate,mar-transferdate
Iam calling this two variable in select statement like '+@sqlquery1+','+@sqlquery2+' but out came like
jan2015,feb2015,march2015,jan-Transferdate,feb-transferdate,mar-transferdate
but i need out put like
jan2015,jan-Transferdate,feb2015,feb-transferdate,,march2015,mar-transferdate

Answers (1)