Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you create a wide table in SQL Server 2008? and what are its limitations on use?

I was reading the Maximum Capacity Specifications for SQL Server and I came across the designation of a wide table. It's different from a standard table in that is can have as many as 30,000 columns as opposed to a normal (narrow) table that is limited to the more familiar 1024 columns. I googled for wide table, but nothing seem to come up relevant. Does this new table type have a more formal name???

So why do we have two different types of tables, how do you create this special table and what are the limitations of using this table that can seemingly hold more data ? anhyone know ?

like image 256
MikeJ Avatar asked May 28 '09 19:05

MikeJ


People also ask

How do I create a wide table in SQL Server?

To create or change a table into a wide table, you add a column set to the table definition. The maximum number of nonsparse columns plus computed columns in a wide table remains 1,024. By using wide tables, you can create flexible schemas within an application. You can add or drop columns whenever you want.

Is there a limit to SQL table?

The internal representation of a MySQL table has a maximum row size limit of 65,535 bytes, even if the storage engine is capable of supporting larger rows. BLOB and TEXT columns only contribute 9 to 12 bytes toward the row size limit because their contents are stored separately from the rest of the row.

What is the maximum size of table in SQL Server?

There is practically no limit to the logical size of a SQL Server table. However, the underlying hardware, data model, and configuration will limit what is practically possible. 168 TB is very very large, but it's been done.


1 Answers

A wide table is a table that uses column sets and sparse columns. It still follows the same width restrictions per row (8019 bytes) - so you'd typically only use it when your columns are mostly all nulls.

See here for more info on...

  • special table types in SQL 2008
  • column sets
  • sparse columns
like image 94
Scott Ivey Avatar answered Sep 21 '22 13:09

Scott Ivey