how many columnscan I have in sql 2008

Posted on 2011-10-03
Last Modified: 2012-05-12
I have a really big table I would like to make in my sql db.  What is the maximum amount of columns I can have?  Any concerns?
Question by:al4629740
    LVL 15

    Expert Comment

    by:Minh Võ Công

    Author Comment

    sooo, 30000?
    LVL 19

    Accepted Solution

    Hi al4629740,

    30000 is the limit for the "wide" table, where most of the columns contain NULLs. You should be more concerted about "Bytes per row" limit, which is 8,060 bytes. There are cases, when total amount of data in a row can exceed 8 KB, but that's another story and is not applicable to a table with insane number of columns :)

    IMHO you should reconsider your database design. Maybe you should create "vertical" table?

    LVL 25

    Expert Comment

    I totally agree with Rimvis. Its not the number of column but the size of the row that will decide the number of fields in the table.

    Author Comment

    How do I know how many bytes per row there will be?
    LVL 19

    Expert Comment


    Look for row size calculations:

    Row_Size = Fixed_Data_Size + Variable_Data_Size + Null_Bitmap + 4

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive + Dolby Voice = No More Audio Complaints!

    Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

    Let's review the features of new SQL Server 2012 (Denali CTP3). It listed as below: PERCENT_RANK(): PERCENT_RANK() function will returns the percentage value of rank of the values among its group. PERCENT_RANK() function value always in be…
    Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now