Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 Database Design and Application Architecture
 What are the maximum columns that SQL can handle?

Author  Topic 

tuongvi
Starting Member

1 Post

Posted - 2008-03-07 : 12:53:59
What are the maximum columns that SQL can handle?
If I use a table that has about 300 columns and 100,000 records for a web application, Is it going to cause a performance problem?
Have anyone experience in using the size of table like this on web application?

Thank you,
Vi

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-03-07 : 13:01:05
This is a terrible choice for the database design.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

dataguru1971
Master Smack Fu Yak Hacker

1464 Posts

Posted - 2008-03-07 : 18:10:41
Wow.

The ROW is limited to just of 8000 bytes of data.

So you could have as many columns as will fit in 8000 bytes across (you figure this by the datatype and size on disk it uses. BIT takes 1 byte for example and char(10) takes 10.

So you could theoretically just have 1 column with varchar(8000) or 8000 columns of BIT type. Neither of those are a good idea, btw.



Poor planning on your part does not constitute an emergency on my part.

Go to Top of Page

rmiao
Master Smack Fu Yak Hacker

7266 Posts

Posted - 2008-03-08 : 01:39:10
>> What are the maximum columns that SQL can handle?

1024 columns per table.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-03-10 : 22:11:13
quote:
Originally posted by tuongvi

What are the maximum columns that SQL can handle?
If I use a table that has about 300 columns and 100,000 records for a web application, Is it going to cause a performance problem?
Have anyone experience in using the size of table like this on web application?

Thank you,
Vi




You keep changing your first post, so I am quoting it here so that our future replies don't look out of place like the previous ones do.

And the answer to your new question is it depends. Show us some of your queries.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-03-13 : 06:29:57
Read about Maximum capacity specifications in sql server help file

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2008-03-13 : 06:38:44
or have a quick glance here
http://weblogs.sqlteam.com/mladenp/archive/2007/07/24/60267.aspx

_______________________________________________
Causing trouble since 1980
blog: http://weblogs.sqlteam.com/mladenp
SSMS Add-in that does a few things: www.ssmstoolspack.com
Go to Top of Page
   

- Advertisement -