SQL Server Performance

using varchar

Discussion in 'Performance Tuning for DBAs' started by BikeBoy, Mar 17, 2007.

  1. BikeBoy New Member

    Some DBAs are insisting that VARCHAR is a no-no for small columns, while others say it matters not. Whanted to hear some opinions on that, what are the index implications, etc.

  2. ndinakar Member

    depends on a lot of factors. whats the nature of the data that goes in? is it all numbers/nulls? or would there be string values? If you have string values there's really not much debate. If the column is for values of states (in US) with values always being 2 characters like 'CA', 'AL'..etc its better to use CHAR(2). so no knowing what type of values goes in its hard for anyone here to pass opinions.

    Dinakar Nethi
    SQL Server MVP
  3. FrankKalis Moderator

    I guess one argument in this discussion might be, that each VARCHAR column has an overhead of 2 bytes in the column offset array. So, if such data does not vary greatly in length, it could be worth investigating such a CHAR without an entry in the column offset array to "save" these 2 bytes. Will that make however the distinction between a good and a bad performing system? I seriously doubt that.

    Frank Kalis
    Microsoft SQL Server MVP

Share This Page