• dwain.c (11/4/2013)


    Jeff Moden (11/4/2013)


    shashianireddy (11/4/2013)


    sql 2008 version ,,nvarchar(MAX)

    You're using NVARCHAR(MAX) for a housenumber???? In SQL Server 2008???? Why?????

    You probably don't release it but you cannot rebuild a clustered index in an Online fashion in SQL Server 2008 if the table contains a blob. This is a totally unneccessary blob.

    Yes, yes... I know... all of your character based columns are NVARCHAR(MAX) because someone believes that "Premature optimization is the root of all evil." The problem is no one ever considers such things as what I've just mentioned and even fewer go back and optimize when they're supposed to.

    I strongly recommend that someone go fix that table to have the correctly sized datatypes.

    Glad to see I'm not the only one that felt that way. Although your feelings seem a bit stronger on the subject. Probably because you're not seeing such nonsense as frequently as I do.

    The reason why I don't see such nonsense that often is because I've trained my Developers. I would never allow such a table design to even go into Dev never mind Prod. This is the kind of garbage that some of the automatic front-end designer software does. What really kills me is that one of the products that does it is Microsoft software.

    I'm all for the avoidance of prematue optimization but any system or human that creates all NVARCHAR(MAX) or even all NVARCHAR(4000) for all character based columns in a table is way over the top so far as I'm concerned.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)