Hi @T.Zacks ,
can i refer more than 1500 columns in sql server?
As mentioned by Erland, the maximun number of columns is 4096
per SELECT statement.
periods table has periods like 1Q 2010, 2Q 2010, 3Q 2010, 4Q 2010, 2010 FYA............2099 FYE
I counted above and found that there were around (2099-2010)*5=445
columns needed in your dynamic pivot. It is enough since it is smaller than 4096.
I also created one table with 1050
rows and could perform the pivot function successfully with more than 1024
columns in the result from my side.
If you have more than 4096/89=46
columns per year or have more years beyond 2099
, then you have to find a second solution. For example, you could split the years into batches or find other solutions in other side.
Best regards,
Melissa
If the answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.