Should I store HTML as nvarchar(MAX) or ntext?

后端 未结 3 1061
太阳男子
太阳男子 2021-02-19 20:23

I don\'t know if there\'s a limit to the number of characters if I choose nvarchar(MAX), and I\'m not sure how many characters I would need anyways.

What\'s the standard

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-19 20:57

    The advantages of using nvarchar(MAX) are that you can run functions such as Replace, Left, Len etc on nvarchar(MAX) but not on ntext. ntext local variables also cannot be created in stored procedures however nvarchar(MAX) can.

    ntext is also likely to be deprecated in the future in favour of nvarchar(MAX) see:

    ntext, text, and image

提交回复
热议问题