How to declare a blob in SQL Server

后端 未结 1 1163
余生分开走
余生分开走 2021-01-17 08:01

I want to do some tests to my database, (like turning off the machine while its still writting something) To do this I\'m planing to insert a movie file in database with 700

相关标签:
1条回答
  • 2021-01-17 08:13

    Binary(50) will hold 50 bytes - this is not going to be enough to hold 700mb.

    From MSDN:

    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.

    You should use VARBINARY(MAX):

    Variable-length binary data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of the data entered + 2 bytes.

    You could also use Image, though it is deprecated.

    0 讨论(0)
提交回复
热议问题