Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - nvarchar length
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

nvarchar length

 Post Reply Post Reply
Author
zMaestro View Drop Down
Senior Member
Senior Member


Joined: 11 May 2003
Location: Egypt
Status: Offline
Points: 1183
Post Options Post Options   Thanks (0) Thanks(0)   Quote zMaestro Quote  Post ReplyReply Direct Link To This Post Topic: nvarchar length
    Posted: 20 August 2006 at 3:56am
sorry for this newbie questions...
In mssql, does the 'length' referee to the max size of this field?
i.e. if a column is nvarchar, i set its length to 250
does this means it only holds 250 characters?
 
and why the ntext is set by default to 16?
 
thanks.
Back to Top
jeffdaro View Drop Down
Groupie
Groupie


Joined: 15 April 2005
Status: Offline
Points: 171
Post Options Post Options   Thanks (0) Thanks(0)   Quote jeffdaro Quote  Post ReplyReply Direct Link To This Post Posted: 20 August 2006 at 6:11am
These are two different datatypes. In your first question, yes 250 characters is the max for THAT varchar you specified. If you made the same field in char, you'd get a 250 character field, with the spaces padded on the end of the data to fill out to 250 characters. So char is great for something like a simple zip code that will always be 5 characters, but it would be awful for say a city name since they could be any range of sizes, so you'd use varchar.

nText is the unicode version of a text field. Text fields are much like varchar but handle a lot more data.

Check out this article, which explains the basics of the SQL datatypes pretty well.

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.