Is there a big technical difference between VARBINARY(MAX) and IMAGE data types?

前端 未结 4 1427
南方客
南方客 2020-12-18 20:19

I was reading on internet these statements about SQL Server data types:

  1. VARBINARY(MAX) - Binary strings with a variable length

4条回答
  •  [愿得一人]
    2020-12-18 20:46

    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.

    In fact, VARBINARY can store any data that can be converted into a byte array, such as files, and this is the same process that IMAGE data type uses, so, by this point of view, both data types can store the same data. But VARBINARY have a size property, while IMAGE accepts any size up to the data type limits, so when using IMAGE data type, you will spend more resources to store the same data. In a Microsoft® SQL Server®, the IMAGE data type is really deprecated, then you must bet in VARBINARY data type.

    But be carefull: The Microsoft® SQL Server® CE® (including the latest 4.0 version) still using IMAGE data type and probably this data type will not "disappears" so soon, because in Compact Edition versions, this data type is better than any other to fast files storage.

提交回复
热议问题