Hi
I often have the dilemma of whether to use Text type or Varchar type.
Normally the situation is that the user will input 50 characters however in
some cases he will input 2000 characters should I make the field Text or
Varchar(2000)
Technically the question is whether a varchar field is assigned the space
automatically or only on request also how significant is the overhead of
using the Text type
Thank you in advance,
Shmuel Shulman
SBS Technologies LTD"S Shulman" <smshulman@.hotmail.com> wrote in message
news:%23vJQVG0nFHA.3380@.TK2MSFTNGP12.phx.gbl...
> Hi
> I often have the dilemma of whether to use Text type or Varchar type.
> Normally the situation is that the user will input 50 characters however
> in some cases he will input 2000 characters should I make the field Text
> or Varchar(2000)
> Technically the question is whether a varchar field is assigned the space
> automatically or only on request also how significant is the overhead of
> using the Text type
>
The "var" in varchar is because the storage is variable. It only takes up
as much space as you use (plus a small fixed overhead).
Using the text type causes a 16-byte locator to be stored in the row instead
of the actual value. The actual value is stored on another page. So the
overhead of using Text is mainly the extra read required to get to the
actual value. For 50-2000 characters, use Varchar.
David|||Thanks you for your response,
Shmuel
"David Browne" <davidbaxterbrowne no potted meat@.hotmail.com> wrote in
message news:e7rPgN0nFHA.3540@.TK2MSFTNGP10.phx.gbl...
> "S Shulman" <smshulman@.hotmail.com> wrote in message
> news:%23vJQVG0nFHA.3380@.TK2MSFTNGP12.phx.gbl...
> The "var" in varchar is because the storage is variable. It only takes up
> as much space as you use (plus a small fixed overhead).
> Using the text type causes a 16-byte locator to be stored in the row
> instead of the actual value. The actual value is stored on another page.
> So the overhead of using Text is mainly the extra read required to get to
> the actual value. For 50-2000 characters, use Varchar.
> David
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment