UCS-2 and SQL Server

前端 未结 2 935
感情败类
感情败类 2020-12-11 05:17

While researching options for storing mostly-English-but-sometimes-not data in a SQL Server database that can potentially be quite large, I\'m leaning toward storing most st

2条回答
  •  青春惊慌失措
    2020-12-11 05:55

    What do you mean by "swimming up the UCS-2 stream"?

    Here are your options:

    • Use the new 2012 _SC collations (https://msdn.microsoft.com/en-us/library/ms143726.aspx). This idea comes from srutzky. You should check out his answer. This is by far the best solution.

    Not recommended but possible:

    • Implement a UDT. This will be a lot of work and you will loose tolling support (OR mapping and certainly some SQL Server features that work on native types).
    • Use varbinary(max): Requires you to do custom conversion code. No range indexing.
    • Use nvarchar(N) and turn on row compression. Starting with SQL Server 2008 R2 this will use an encoding that is as compact as UTF-8. But this requires enterprise edition.

    See the comments to read about the severe drawbacks that these approaches have.

提交回复
热议问题