1,630 questions

3,175 answers

1,704 comments

478 users

Is there a maximum number of columns for a listbuilder?

0 votes

Is it possible to have a listbuilder with more than 300 columns?

asked Aug 21 by mpuffer (175 points)   4 14 23

1 Answer

0 votes

I don't think so. The limit on former SQL server version was 1024. I tried it with 350 columns and it worked. I believe as long as the table row size is less than 8060 bytes, you have the option to create the spec and I don't see limits within SDK or Infinity framework.

Here is the warning I received from SQL server when I create the table with all 350 columns as varchar(20).

Warning: The table "tableName" has been created, but its maximum row size exceeds the allowed maximum of 8060 bytes. INSERT or UPDATE to this table will fail if the resulting row exceeds the size limit.

Here is the table and populating script with view spec.

        <QueryViewSpec
        xmlns="bb_appfx_queryview"
        xmlns:c="bb_appfx_commontypes" 
        ID="120d99c4-f9d6-4585-affe-38b3303ba546"
        Name="Three Hundred Fifty Column Query"
        Description="A view defined for querying on three hundred fifty column records"
        Author="Abel Debela"
        IsRoot="true"
        PrimaryKeyField="ID"
        RecordType="Three Hundred Fifty Column"
        c:SecurityUIFolder="Three Hundred Fifty Column"
        >

        <!-- define the view used to return data for the query -->
        <ViewImplementation ViewName="USR_V_QUERY_THREEHUNDREDFIFTYCOLUMN">
            <ViewSQL>
                <![CDATA[
    select
        ID,COLUMN1,COLUMN2,COLUMN3,COLUMN4,COLUMN5~~~~~~~~~,COLUMN338,COLUMN339,COLUMN340,COLUMN341,COLUMN342,COLUMN343,COLUMN344,COLUMN345,COLUMN346,COLUMN347,COLUMN348,COLUMN349
    from dbo.USR_THREE_HUNDRED_FITY_COLUMN_TABLE            
                ]]>
            </ViewSQL>
        </ViewImplementation>

        <!-- describe each field in the view output -->
        <Output>
            <OutputFields>
                <OutputField Caption="System record ID" Category="System Fields" Name="ID" />
    <OutputField Name="COLUMN1" Caption="COLUMN1" DataType="String" />
    <OutputField Name="COLUMN2" Caption="COLUMN2" DataType="String" />
    <OutputField Name="COLUMN3" Caption="COLUMN3" DataType="String" />
    <OutputField Name="COLUMN4" Caption="COLUMN4" DataType="String" />
    <OutputField Name="COLUMN5" Caption="COLUMN5" DataType="String" />
~~~~~~
    <OutputField Name="COLUMN318" Caption="COLUMN318" DataType="String" />
    <OutputField Name="COLUMN319" Caption="COLUMN319" DataType="String" />
    <OutputField Name="COLUMN320" Caption="COLUMN320" DataType="String" />
    <OutputField Name="COLUMN321" Caption="COLUMN321" DataType="String" />
    <OutputField Name="COLUMN322" Caption="COLUMN322" DataType="String" />
    <OutputField Name="COLUMN323" Caption="COLUMN323" DataType="String" />
    <OutputField Name="COLUMN324" Caption="COLUMN324" DataType="String" />
    <OutputField Name="COLUMN325" Caption="COLUMN325" DataType="String" />
    <OutputField Name="COLUMN326" Caption="COLUMN326" DataType="String" />
    <OutputField Name="COLUMN327" Caption="COLUMN327" DataType="String" />
    <OutputField Name="COLUMN328" Caption="COLUMN328" DataType="String" />
    <OutputField Name="COLUMN329" Caption="COLUMN329" DataType="String" />
    <OutputField Name="COLUMN330" Caption="COLUMN330" DataType="String" />
    <OutputField Name="COLUMN331" Caption="COLUMN331" DataType="String" />
    <OutputField Name="COLUMN332" Caption="COLUMN332" DataType="String" />
    <OutputField Name="COLUMN333" Caption="COLUMN333" DataType="String" />
    <OutputField Name="COLUMN334" Caption="COLUMN334" DataType="String" />
    <OutputField Name="COLUMN335" Caption="COLUMN335" DataType="String" />
    <OutputField Name="COLUMN336" Caption="COLUMN336" DataType="String" />
    <OutputField Name="COLUMN337" Caption="COLUMN337" DataType="String" />
    <OutputField Name="COLUMN338" Caption="COLUMN338" DataType="String" />
    <OutputField Name="COLUMN339" Caption="COLUMN339" DataType="String" />
    <OutputField Name="COLUMN340" Caption="COLUMN340" DataType="String" />
    <OutputField Name="COLUMN341" Caption="COLUMN341" DataType="String" />
    <OutputField Name="COLUMN342" Caption="COLUMN342" DataType="String" />
    <OutputField Name="COLUMN343" Caption="COLUMN343" DataType="String" />
    <OutputField Name="COLUMN344" Caption="COLUMN344" DataType="String" />
    <OutputField Name="COLUMN345" Caption="COLUMN345" DataType="String" />
    <OutputField Name="COLUMN346" Caption="COLUMN346" DataType="String" />
    <OutputField Name="COLUMN347" Caption="COLUMN347" DataType="String" />
    <OutputField Name="COLUMN348" Caption="COLUMN348" DataType="String" />
    <OutputField Name="COLUMN349" Caption="COLUMN349" DataType="String" />


            </OutputFields>
        </Output>

    </QueryViewSpec>

CREATE TABLE dbo.USRTHREEHUNDREDFITYCOLUMN_TABLE (ID UNIQUEIDENTIFIER DEFAULT NEWID()
,COLUMN1 varchar(5) ,
COLUMN2 varchar(5) ,
COLUMN3 varchar(5) ,
COLUMN4 varchar(5) ,
COLUMN5 varchar(5) ,
~~~~~~~~~~~~~~~
COLUMN347 varchar(5) ,
COLUMN348 varchar(5) ,
COLUMN349 varchar(5) ,
COLUMN350 varchar(5) )

Declare @LOOPCOUNTER int = 0
Declare @DUMVAL varchar(5)
While @LOOPCOUNTER <=10
begin
    select @DUMVAL = convert(varchar(36),newId())
    INSERT INTO dbo.USR_THREE_HUNDRED_FITY_COLUMN_TABLE (COLUMN1,COLUMN2,COLUMN3,COLUMN4,COLUMN5,COLUMN338,COLUMN339,COLUMN340,COLUMN341,COLUMN342,COLUMN343,COLUMN344,COLUMN345,COLUMN346,COLUMN347,COLUMN348,COLUMN349,COLUMN350)  
    values (@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL,@DUMVAL)
    set @LOOPCOUNTER = @LOOPCOUNTER + 1
end

select * from dbo.USR_THREE_HUNDRED_FITY_COLUMN_TABLE

)
answered Aug 21 by abeldebela (232 points)   1 4 14
...