Why not use varchar(max)?

后端 未结 8 2002
广开言路
广开言路 2020-12-05 17:03

I\'m a bit old school when it comes to database design, so I\'m totally for using the correct data sizes in columns. However, when reviewing a database for a friend, I notic

8条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-05 17:29

    They should NOT be used unless you expect large amounts of data and here is the reason why (directly from Books Online):

    Columns that are of the large object (LOB) data types ntext, text, varchar(max), nvarchar(max), varbinary(max), xml, or image cannot be specified as key columns for an index.

    If you want to cripple performance, use nvarchar for everything.

提交回复
热议问题