• Jeff Moden (7/1/2016)


    ScottPletcher (7/1/2016)


    I still say don't explicitly code it unless the code requires it (some system procs require unicode strings specifically, for example), because it can cause performance errors or mismatches but cannot prevent any.

    Understood but that's the very thing I'm talking about. While it's a good idea to avoid performance errors and what you're talking about can help, it's also good to avoid data errors and the method you're talking about could cause an error. Always paying attention to what should be typed is the best policy. Choosing the lesser of two evils is still an "evil" thing. Better to just do it right. "Must look eye". 🙂

    So if a column changes from non-unicode to unicode, you're going to insist that all existing code be changed to explicitly specify unicode strings for that column?

    What about when that value is being concatenated to another value that is not unicode? Forcing any part of a sgring to be unicode ultimately forces it all to be unicode, and unicode could truncate the string at 4000 bytes.

    SQL DBA,SQL Server MVP(07, 08, 09) A socialist is someone who will give you the shirt off *someone else's* back.