Re: Char and Varchar
Posted in 2000
From: "Peter Morris" <no_sp@m.please> > >My company proposes changing all char(x) columns to varchar(x) >on the grounds that > > "Char stores data in a fixed length format and if data varies in >length from row to row then space is wasted. By using varchar we >can use the storage space more efficiently " > >What about fixed length fields? If we have a char(10) column, >and we know that every item in that column will be exactly 10 >characters long, then is there any advantage in making it a varchar? > >I think it might even be less efficient. I presume that for a varchar >the database must store the length of the data, in addition to the data, >so there would be extra resources used. > >Am I right? For a fixed length field, is char or varchar better? >Or doesn't it make any difference? Here's another idea -- tell your boss that switching to a smaller font on all company documents will save space, as well as using fewer electrons. _____________________________________________________________________________________ Get more from the Web. FREE MSN Explorer download : http://explorer.msn.com