question

Steve Jones - Editor avatar image
Steve Jones - Editor asked

CREATE TABLE Limits

What is the largest row size I can create in a table? How many columns or bytes can it contain?

database-designddl
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Matt Whitfield avatar image
Matt Whitfield answered

Now that is a question.

The maximum size is 8,060 bytes - but - in SQL Server 2008 varchar, nvarchar, varbinary, sql_variant and CLR user-defined type data can go into the 'row overflow' (see this link). That link also describes how large value (MAX), xml or blob (Binary Large OBject) data does not form part of that 8,060 bytes (except for a pointer to the data - usually 16-24 bytes - depending on edition).

There is also a limit of 8,018 bytes for rows in tables using SPARSE columns.

Edit -> sorry missed the bit about maximum number of columns. Details on most of the limits of SQL Server can be found here.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.