开发者

SQL nvarchar considerations

开发者 https://www.devze.com 2022-12-19 21:50 出处:网络
What\'s your strategy for determining nvarchar column sizes say for a address field? Do you always use nvarchar(max) or a fixed maximum size?

What's your strategy for determining nvarchar column sizes say for a address field? Do you always use nvarchar(max) or a fixed maximum size?

There is nothing worse than data integration breaking due to too small columns. Wh开发者_如何学JAVAat are possible implications of using nvarchar(max) vs. a fixed maximum varchar size? I understand there is something about indices getting too large but what about query performance? Is there anything else to consider?


One row or field per address line, perhaps 100 long.

In ye olden days, people had to write on an envelope. No need for War and Peace epic addresses

And how would you break out post code, country, town etc if it was one field. Or lookups as Astander mentioned too.

Anyway, don't use max: there are some overhead because it's a BLOB datatype.

0

精彩评论

暂无评论...
验证码 换一张
取 消