Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

runrig (3385)

runrig
  dougwNO@SPAMcpan.org

Just another perl hacker somewhere near Disneyland

I have this homenode [perlmonks.org] of little consequence on Perl Monks [perlmonks.org] that you probably have no interest in whatsoever.

I also have some modules [cpan.org] on CPAN [cpan.org] some of which are marginally [cpan.org] more [cpan.org] useful [cpan.org] than others.

Journal of runrig (3385)

Wednesday April 14, 2004
05:10 PM

Varchar columns

[ #18336 ]

I just noticed that in our SqlServer databases we have alot of 'varchar(1,0)' columns. I know that if you have a long character column that tends to be short or blank, you can save space by making it a varchar instead of a char, but it can't be worth making a varchar for a one character field, can it? (And in most cases, the fields I'm looking at will always be 'Y' or 'N').

Update: In my homegrown DBI sql query tool the '0' above is from the 'SCALE' for numeric columns, which I display if the value is defined (whether or not the column is numeric). I'm not sure if this is also the reserve length for varchar columns, or if SqlServer happens to define it as zero.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • VARCHAR with length 1 will cost you an extra byte per column and row, plus unless your DB's optimizer is very smart it might make some operations slower.