Skip to content

*.dannyg

an extension of dannyg

Menu
  • Home
  • art
  • inspiration
  • music
  • poetry
  • Recipes
  • writings
Menu

Deciphering SQL Server Field Length for N types

Posted on October 15, 2010

N types are used for implementing double-byte character sets.  This is sometimes used in designed consideration.  This can be quite confusing as the SQL Server Management Studio can be misleading or a little bit confusing.

Let’s look at one simple table.

image

Notice Representative_Quote is an nvarchar(500).  So what does this mean?  It means that you can have up to 500 characters in this field that are of any character set. 

What if you are to run an sp_help on this same table?  (Note: The equivalent shortcut key for sp_help in SSMS is Alt+F1).

image

Notice how the length size is 1000.  This size is in bytes. 

So what this is saying is that for every 1 character entered in the field, SQL Server reserves two bytes for the nvarchar type.

 

Technorati Tags: sql-server,datatypes

Leave a Reply

You must be logged in to post a comment.

Recent Posts

  • Reading Room
  • Inspirational Movies / TV shows
  • Remove passphrase from PEM file
  • Parallels Multihoming a CentOS Server
  • Forced Failures

Archives

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
©2026 *.dannyg | Design: Newspaperly WordPress Theme