Click here to Skip to main content
   

Database

 
Questionchar(255) vs varchar(255) vs varchar(MAX) Pinmemberdevvvy1-Feb-13 19:22 
I guess, the question is, why would I use
 
char(255)
 
instead of
 
varchar(255)
 
When I specify varchar(255), does SQL sever allocate [255] per cell? or does it allocate dynamically? If it statically allocate [255] bytes, then I don't see if there's much practical difference between char(255) and varchar(255) -- well, except varchar always store a one (or two) byte termination character internally.
 
If SQL server allocates 255 bytes when i specify varchar(255), then what about varchar(MAX)?
 
Thanks
dev

AnswerRe: char(255) vs varchar(255) vs varchar(MAX) PinmvpRichard MacCutchan2-Feb-13 0:07 
GeneralRe: char(255) vs varchar(255) vs varchar(MAX) [modified] Pinmemberdevvvy2-Feb-13 16:39 
AnswerRe: char(255) vs varchar(255) vs varchar(MAX) PinmemberPIEBALDconsult2-Feb-13 6:22 
GeneralRe: char(255) vs varchar(255) vs varchar(MAX) Pinmemberdevvvy3-Feb-13 0:30 
GeneralRe: char(255) vs varchar(255) vs varchar(MAX) Pinmemberjschell3-Feb-13 7:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web04 | 2.8.150326.1 | Last Updated 27 Mar 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid