How to increase the limit of columns per select statement in azure sql

Aiman Aslam 6 Reputation points

Environment = Microsoft Azure SQL Database
I have dynamic query which has more than 4096 columns in select statement and I am getting this error while executing this.
The number of elements in the select list exceeds the maximum allowed number of 4096 elements.
I can't reduce the number of columns per select statement. Is there any way to increase the limit of columns per select statement in azure SQL database.?


Azure SQL Database
{count} vote

2 answers

Sort by: Most helpful
  1. GeethaThatipatri-MSFT 27,017 Reputation points Microsoft Employee

    Hi @Aiman Aslam Welcome to the Microsoft Q&A forum, and thanks for reaching out.
    Unfortunately that we don’t have a plan to increase the limit at this time.

    So, I suggest you review your data model and keep the number of points under the 4K limitation to avoid errors in future development.

    Please feel free to let me know if you have any concerns or further questions on this.


  2. Erland Sommarskog 100.8K Reputation points MVP

    4096 columns in a SELECT statement? The mind boggles. Time for a redesign, I guess.

    Although, you could look at sparse tables and column sets. With sparse column, you can have up to 30000 columns per tables.

    0 comments No comments