SQL Server BLOB Tools - Import, Export, View and Edit

In SQL Server, there isn’t a data type named BLOB like in some other database systems. However, it offers several data types to store binary data, including VARBINARY, BINARY, and IMAGE (although IMAGE is deprecated as of SQL Server 2005 and should be avoided in new development). More: SQL Server [IMAGE, VARBINARY(MAX)] (BLOB).

SQL Server BLOB - type family and size limits

Type in Microsoft SQL ServerMaximum size
VARBINARY(MAX)up to 2 GB (the recommended type)
IMAGE2 GB, but deprecated since SQL Server 2005
FILESTREAMfor values beyond 2 GB - data lives in the file system

BLOB versus CLOB in Microsoft SQL Server

SQL Server has no types named BLOB or CLOB at all: the equivalents are `VARBINARY(MAX)` for binary and `VARCHAR(MAX)` / `NVARCHAR(MAX)` for text. The `MAX` suffix is what matters - a plain `VARBINARY(n)` tops out at 8,000 bytes.

What limits you first

2 GB per value. Beyond that you have to move to FILESTREAM, which stores the payload in the file system and keeps a pointer in the table. SET TEXTSIZE can also cap how much a single read returns.

BLOB from the command line

Things that bite with BLOB in Microsoft SQL Server