If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Unanswered: No of Columns in a select clause

All,

I have exexuted a select statement which is having more than 2500 columns,But i got the error message.

The transaction was aborted because it used too much stack space. Either use sp_configure to increase the stack size, or break the query into smaller pieces. spid: 225, suid: 790, hostname: X3RWTYR, application name: SQL_Advantage

There is a difference between the limits of ASE and the limits of your system. I do not know for sure if there is a maximum amount of columns you can specify in a query, although there is such a limit in how many columns a table can have.

Taken in account you're trying to select 2500 columns, I think it's a resource-issue. There just isn't enough memory allocated for ASE, or there isn't enough memory in your system. Anyhow, 2500 columns is very, very much for a single selectstatement, so I'd rather try to rewrite it in smaller queries than to boost or tune your system so it can handle this amount of columns.

I have exexuted a select statement which is having more than 2500 columns,But i got the error message.

The transaction was aborted because it used too much stack space. Either use sp_configure to increase the stack size, or break the query into smaller pieces. spid: 225, suid: 790, hostname: X3RWTYR, application name: SQL_Advantage

1. The max no of columns you can have is 1024 per table.
2. Sum of column size cannot exceed page size