How to convert kilobytes to varbinary?

0

Whenever I need to store files in a database I use the varbinary (max) field, which is the maximum that the data type supports, and I simply assign a byte array to the field to store it, at this moment I am in the same situation and I have a question, is it possible to convert kilobytes, which weighs the file, to varbinary ?, what is the purpose of this ?, if I have limited to store a file of 4 mb, I can define the field varbinary of the size to store 4 mb and not use the "max" of the data type.

Greetings

    
asked by elchente23 23.06.2016 в 21:11
source

1 answer

2

According to the SQL Server documentation, it should be use varbinary (max) when the column data entries exceed 8,000 bytes. In this case it would be convenient to perform the validation of the maximum allowed size before storing it in the database.

If you are interested in knowing the size of the stored in a varbinary (max) field, you can refer to the following link .

    
answered by 13.07.2016 / 06:53
source