Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2006

    Exclamation Unanswered: How much storage space does nvarchar() eats? Always max?

    Hello, everybody,

    I am in need of storing long pieces of text in database, length between 2000 and 4000 characters (nvarchar limit).

    If I have a column in a table:

    my_text nvarchar(2000)

    does this mean that in database the size used will always be 2000*2=4000 bytes at least (+ rounding), independent on what the real length of the text stored is?

    Anoter alternative - storing texts in files is expected to become unmanageable very soon, so I would like to keep to the db.

    Or, would it be reasonable to have such a table:

    my_text_1 nvarchar(500),
    my_text_2 nvarchar(500),
    my_text_3 nvarchar(500),
    my_text_4 nvarchar(500)

    Or declaration already means the space for a column is reserved even if it is nullable?

    My DBs are MS SQL Server 2000/2005.

  2. #2
    Join Date
    Jul 2004
    As I understand it the amount of space used is limited to the size of the data you have in the nvarchar field. So "hello world" will take up the same amouint of space in an nvarchar(20) as it does in an nvarchar(200).

  3. #3
    Join Date
    Nov 2002
    But why use unicode? Do you really need it?

    It's a Great Day for America everybody!

    dbforums Yak CorralRadio 'Rita
    dbForums Member List
    I'm Good Once as I ever was

    The physical order of data in a database has no meaning.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts