Binary Data Types in SQL Server with Examples

  Total Views : 456
  Comments : 0
 
  Keywords : SQL server binary data types, Binary and varbinary data type examples,

Here we will learn what are the binary data types in sql server and different types of binary data types in sql server and usage of binary data types in sql server.

SQL Binary Data Types

In SQL binary data types are used to store any kind of binary data like images, word files, text files, etc… in table. In binary data types we have option like allow users to store fixed length or variable length of bytes. 

 

In SQL we have different type of binary data types are available those are

 

     - SQL binary datatype

 

     - SQL varbinary datatype

 

     - SQL varbinary(max) datatype

SQL Binary DataType

We can use this datatype whenever the size of data entries are consistent

SQL varbinary DataType

We can use this datatype whenever the size of data entries are considerably varies.

SQL varbinary(max) DataType

We can use this datatype whenever the size of data entries exceeds 8000 bytes.

 

Please check following table for more details regarding binary data types

 

Data TypeDescriptionStorage
binary(n) It’s fixed length binary data and we can store maximum 8000 bytes Based on defined size
varbinary It’s variable length binary data and we can store maximum 8000 bytes Based on number of bytes
varbinary(max) It’s variable length character string and we can store maximum 2GB data Based on number of bytes

 Comments (0)

Be the first to give your valuable feedback

Leave a comment

  • Default Tutlane User