SQL Server, nvarchar(MAX) or ntext, image or varbinary?

后端 未结 2 1372
天命终不由人
天命终不由人 2021-01-18 01:26

When should I choose one or the other? What are the implications regarding space and (full-text) indexing?

BTW: I\'m currently using SQL Server 2005 planing to upgra

相关标签:
2条回答
  • 2021-01-18 01:30

    The new (max) fields make it a lot easier to deal with the data from .NET code. With varbinary(max), you simply set the value of a SqlParameter to a byte array and you are done. WIth the image field, you need to write a few hundred lines of code to stream the data into and out of the field.

    Also, the image/text fields are deprecated in favor of varbinary(max) and varchar(max), and future versions of Sql Server will discontinue support for them.

    0 讨论(0)
  • 2021-01-18 01:33

    Once you put it in the blob, it's going to be difficult to be used for normal SQL comparison. See Using Large-Value Data Types.

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