I was reading on internet these statements about SQL Server data types:
VARBINARY(MAX)
- Binary strings
with a variable length can store up
to 2^31-1 bytes.
IMAGE
- Binary strings with a
variable length up to 2^31-1
(2,147,483,647) bytes.
Is there a really big technical difference between VARBINARY(MAX)
and IMAGE
data types?
If there is a difference: do we have to customize how ADO.NET inserts and updates image data field in SQL Server?
VARBINARY(MAX) - Binary strings with a variable length can store up to 2^31-1 bytes. IMAGE - Binary strings with a variable length up to 2^31-1 (2,147,483,647) bytes.
The VARBINARY data type holds variable-length binary data. Use this type when the data is expected to vary in size. The maximum size for VARBINARY is 8,000 bytes.
binary [ ( n ) ] Fixed-length binary data with a length of n bytes, where n is a value from 1 through 8,000. The storage size is n bytes. varbinary [ ( n | max) ] Variable-length binary data. n can be a value from 1 through 8,000.
An image is a composite data type. An image file is typically a binary format file.
They store the same data: this is as far as it goes.
"image
" is deprecated and has a limited set of features and operations that work with it. varbinary(max)
can be operated on like shorter varbinary
(ditto for text
and varchar(max)
).
Do not use image
for any new project: just search here for the issues folk have with image
and text
datatypes because of the limited functionality.
Examples from SO: One, Two
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With