SQL Server Performance

varchar options

Discussion in 'ALL SQL SERVER QUESTIONS' started by Wendy elizabeth, Mar 29, 2012.

  1. Wendy elizabeth New Member

    In a new table in sql server 2008 R2 that I will be setting up, I am wondering if there is a problem setting up a column size to be varchar(max) for a 'description' column I am using? I am asking the question since I am obtaining datata from a user daily from an excel spreadsheet. The maximum size for a value in an excel spreadsheet is 32,767 characters. My company says I can not ask the customer anything, I just need to work with what they give us.
    Do you have any suggestions?
  2. Orlando Colamatteo New Member

    No issues. If you were not provided a requirement explicitly stating the upper-bound, then it is smart to provide for the unexpected, in which case a MAX-datatype would be the recommendation. There is slight performance penalty for using MAX-datatypes over n-datatypes, but in your case it sounds like assuming the penalty is justified.
  3. Madhivanan Moderator

    Also any size exceeding 8000 needs max type becuase you cannot have varchar(20000), varchar(374456), etc
  4. Shehap MVP, MCTS, MCITP SQL Server

    ForVarchar (max) , it has 2 major considerations needed to be pointed out :

    · Storage Capacity Consumption since it allows for huge data entitiy to be inserted there (up to 2 GB)

    · Performance consistency since indexes containing such columns wouldn't get any room for online index rebuild but just only offline index rebuild where implications are expected on end users

Share This Page