Which is recomended and Why?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: Which is recomended and Why?

  1. #1
    Anu Guest

    Which is recomended and Why?


    Hi,

    I need to store the description of an item which may have 2000 characters.I
    can store it in SQL Server Database in 2 different ways.

    1.In a Varchar field of 2000 characters.

    2.In 10 Varchar fields of 200 characters.


    I need to know which is the better way of storing it and what is the
    reason.

    Thank u in advance

    Anu

  2. #2
    Rune Bivrin Guest

    Re: Which is recomended and Why?

    I would definitely store it as a single varchar column, for the following
    reasons:

    1. It's the natural choice.
    2. It's much easier to deal with.
    3. It will use slightly less space, since there will only be one piece of
    column metadata and length indicators, rather than 10

    Rune Bivrin


    "Anu" <annupandit@rediffmail.com> wrote in news:3d633c93$1@10.1.10.29:

    >
    > Hi,
    >
    > I need to store the description of an item which may have 2000
    > characters.I
    > can store it in SQL Server Database in 2 different ways.
    >
    > 1.In a Varchar field of 2000 characters.
    >
    > 2.In 10 Varchar fields of 200 characters.
    >
    >
    > I need to know which is the better way of storing it and what is
    > the
    > reason.
    >
    > Thank u in advance
    >
    > Anu
    >



  3. #3
    David Satz Guest

    Re: Which is recomended and Why?

    unless you are using SQL Server 6.5 or older where there was a 255 char max
    for varchar there is no reason not store it in a varchar(2000) column.
    --
    HTH,
    David Satz
    Principal Web Engineer
    Hyperion Solutions
    { SQL Server 2000 SP2/6.5 SP5a } { Cold Fusion 5 SP1 } { VSS }
    (Please reply to group only - emails answered rarely)
    -----------------------------------------------------------------
    "Anu" <annupandit@rediffmail.com> wrote in message
    news:3d633c93$1@10.1.10.29...
    >
    > Hi,
    >
    > I need to store the description of an item which may have 2000

    characters.I
    > can store it in SQL Server Database in 2 different ways.
    >
    > 1.In a Varchar field of 2000 characters.
    >
    > 2.In 10 Varchar fields of 200 characters.
    >
    >
    > I need to know which is the better way of storing it and what is the
    > reason.
    >
    > Thank u in advance
    >
    > Anu




  4. #4
    Zack Guest

    Re: Which is recomended and Why?


    A VarChar is more expensive that a CHAR
    to use, so using 10 is 10 time more expensive.

    To manage the 10 varchar files would also invole more work
    that it is worth.

    Zack

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center