Databases

  1. Home
  2. Computing & Technology
  3. Databases

Binary Data Types in SQL Server

By Mike Chapple, About.com

Binary allow you to store any type of binary data, including entire files of up to 2GB.

Data types in the binary category include:
  • bit variables store a single bit with a value of 0, 1 or NULL.
  • binary(n) variables store n bytes of fixed-size binary data. They may store a maximum of 8,000 bytes.
  • varbinary(n) variables store variable-length binary data of approximately n bytes. They may store a maximum of 8,000 bytes.
  • varbinary(max) variables store variable-length binary data of approximately n bytes. They may store a maximum of 2 gigabytes.
  • image variables store up to 2 gigabytes of data and are commonly used to store any type of data file (not just images).
If the binary data types don’t suit your needs, read more about other SQL Server data types.

Explore Databases

About.com Special Features

Databases

  1. Home
  2. Computing & Technology
  3. Databases
  4. SQL Server
  5. Binary Data Types in SQL Server

©2009 About.com, a part of The New York Times Company.

All rights reserved.