• SanDroid (10/27/2010)


    The Author of this question clearly understood what he was posting and took the time to make sure his question was well worded and that the code worked on a DEFAULT INSTALLATION OF MS SQL SERVER.

    He did indeed understand what he was posting and he did take the time to ensure a well worded question; I won't deny any of that. But that's where our agreement ends.

    There is no such thing as "a" default installation of MS SQL Server. What defaults are presented depends on a lot of things. One of them (the one that happens te be of importance for this discussion) is the Operating System language.

    If you buy a computer in Germany, it will come preconfigured with a German version of Windows. And even if you buy a computer without OS, the operating system installed by a typical German user or at a typical German company will be German.

    And if you ever install SQL Server on a German OS, acccepting all defaults, you'll find that the Server language also defaults to German.

    I do not think this impacted the question. I would have if the date had been ambiguous to human readers (dates like "03-01-2010" are ambiguous, as I don't know if that's January 3rd of March 1st). Everyone who comes here knows enough English to understand what 31-Jan-2010 is, even if their installation of SQL Server doesn't. So I felt absolutely no reason to criticse the question because of this, and I haven't. But I did provide answers when people asked about the date format (for I am here to share knowledge as well as to learn), and I did object when you said that this question "didn't have any" errors, as that is not true.

    IMHO, all code samples I have ever worked with were written for a DEFAULT INSTALLATION OF MS SQL SERVER unless otherwise stated. I believe the same rules apply to the QOTD.

    I believe that for the QotD, as for any code published anmywhere, the rule is to use locale-independent date formats, unless explicitly mentioned otherwise.


    Hugo Kornelis, SQL Server/Data Platform MVP (2006-2016)
    Visit my SQL Server blog: https://sqlserverfast.com/blog/
    SQL Server Execution Plan Reference: https://sqlserverfast.com/epr/