Altering datatype from varchar to nvarchar

  • Hi,

    We are planning to change the datatype from varchar to nvarchar

    What will be the impacts

    IS it drop the Indexes?

    Do we need to create the Indexes again? Do we need to run the maintenace rebuild or reorg Indexes?

  • The most serious impact is that you will double the size of all the data in the affected columns (including anywhere they're used in an index) because NVARCHAR takes 2 bytes per character instead of just one.

    That will affect memory, diskspace, backup time, restore time, processing time, read time, write time, IO throughput, etc, etc.

    And yes, I'd rebuild affected indexes and that means rebuilding the clustered indexes if you just do ALTER TABLE to do this because you'll have page splits galore.

    --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)

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply