Often people in newsgroups ask about maximum size of various objects defined in databases.

The following tables shows the maximum sizes and numbers of various objects defined in MYSql, SQL Server.


MySql Maximums
Char 255 Bytes
Varchar 65,535 Bytes
Binary 255 Bytes
Varbinary 65,535 Bytes
TinyBlob 255 Bytes
TinyText 255 Bytes
Blob 65,535 Bytes (2^16 -1)
Text 65,535 Bytes (2^16 -1)
Medium Blob 16,777,215 Bytes (2^24 -1)
Medium Text 16,777,215 Bytes (2^24 -1)
LongBlog 4,294,967,295 Bytes (2^32 -1)
LongText 4,294,967,295 Bytes (2^32 -1)
Bit Range from 1 to 64
Tinyint The signed range is -128 to 127. The unsigned range is 0 to 255.
BOOL, BOOLEAN true or false
SmallInt The signed range is -32768 to 32767. The unsigned range is 0 to 65535.
MediumInt The signed range is -8388608 to 8388607. The unsigned range is 0 to 16777215.
Int/Integer The signed range is -2147483648 to 2147483647. The unsigned range is 0 to 4294967295.
BigInt The signed range is -9223372036854775808 to 9223372036854775807. The unsigned range
is 0 to 18446744073709551615.
Float Allowable values are -3.402823466E+38 to -1.175494351E-38, 0, and 1.175494351E-38
to 3.402823466E+38.
Double Allowable values are -1.7976931348623157E+308 to -2.2250738585072014E-308, 0, and
2.2250738585072014E-308 to 1.7976931348623157E+308.

Sqlserver Maximums
char 8,000 Char
nchar 4,000 char
varchar 8,000 char
nvarchar 8,000 char
varchar(max) 1,073,741,824 char
nvarchar(max) 536,870,912 char
Tinyint The range is 0 to 255.
SmallInt The signed range is -32768 to 32767.
BigInt The signed range is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807.
Int The signed range is -2,147,483,648 to 2,147,483,647.
money The signed range is -922,337,203,685,477.5808 to 922,337,203,685,477.5807.
smallmoney Allowable values are -214,748.3648 to 214,748.3647.
bit single bit.
binary 8,000 bytes.
varbinary 8,000 bytes.
varbinary(max) 2 GB Data.
image 2 GB Data.
Other Helpful Sql Maximums
Bytes per short string column 8,000
Bytes per GROUP BY, ORDER BY 8,060
Columns in GROUP BY, ORDER BY Limited only by number of bytes
Bytes per index key 900
Bytes per foreign key 900
Bytes per primary key 900
Bytes per row 8,060
Bytes per varchar(max), varbinary(max), xml, text, or image column 2^31-1
Characters per ntext or nvarchar(max) column 2^30-1
Clustered indexes per table 1
Columns per index key 16
Columns per foreign key 16
Columns per primary key 16
Columns per base table 1,024
Columns per SELECT statement 4,096
Columns per INSERT statement 1,024
Connections per client 32,767
Database size 1,048,516 terabytes
Databases per instance of SQL Server 32,767
Filegroups per database 32,767
Files per database 32,767
File size (data) 16 terabytes
File size (log) 2 terabytes
Foreign key table references per table 253
Identifier length (in characters) 128
Instances per computer 50 (Workgroup Edition only 16)
Locks per connection Maximum locks per server
Locks per instance of SQL Server Up to 2,147,483,647
Nested stored procedure levels 32
Nested subqueries 32
Nested trigger levels 32
Nonclustered indexes per table 249
Parameters per stored procedure 2,100
Parameters per user-defined function 2,100
REFERENCES per table 253
Rows per table Limited by available storage
Tables per database Limited by number of objects in a database
Partitions per partitioned table or index 1,000
Statistics on non-indexed columns 2,000
Tables per SELECT statement 256
Triggers per table Limited by number of objects in a database
UNIQUE indexes or constraints per table 249 nonclustered and 1 clustered
User connections 32,767
XML indexes 249