C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

What is the size of nvarchar and varchar?


Posted Date: 03 Jul 2009      Posted By: Sharath Bengaluru      Member Level: Gold     Points: 1   Responses: 8



Hi,
What is the length of nvarchar and varchar datatypes in SQLSERVER?

----
Please Rate my answer if it has found helpful to you.. Happy coding...





Responses

Author: Danasegarane.A    03 Jul 2009Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2


varchar(max)


Indicates that the maximum storage size for the varchar data type is 2^31-1 bytes.

nvarchar(max)


Indicates that the maximum storage size for the nvarchar data type is 2^31-1 bytes.

varbinary(max)


Indicates that the maximum storage size for the varbinary data type is 2^31-1 bytes.


Refer :http://msdn.microsoft.com/en-us/library/ms179910(SQL.90).aspx

Thanks and Regards,
Danasegarane Arunachalam



Author: priya narayan    03 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

VARCHAR and NVARCHAR data types are both character data types that are variable-length.
Below is the summary of the differences between these 2 data types:

VARCHAR(n) NVARCHAR(n)

Character Data Type Non-Unicode Data Unicode Data
Maximum Length 8,000 4,000
Character Size 1 byte 2 bytes
Storage Size(in bytes) Actual Length 2*Actual Length

For more information
Refer :
http://www.sql-server-helper.com/faq/data-types-p01.aspx

Thanks and Regards
Priya

"Motivation is a fire from within. If someone else tries to light that fire under you, chances are that it will burn very briefly." - Stephen Covey



Author: Sachin Kumar    03 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

check this url:

http://www.sql-server-helper.com/faq/data-types-p01.aspx



Author: Ashok    03 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi,

VARCHAR and NVARCHAR data types are both character data types that are variable-length.

<U>VARCHAR</U>
Maximum Length - 8,000
Character Size - 1 byte

<U>NVARCHAR</U>
Maximum Length - 4,000
Character Size - 2 bytes

You would use NVARCHAR data type for columns that store characters from more than one character set or when you will be using characters that require 2-byte characters, which are basically the Unicode characters such as the Japanese Kanji or Korean Hangul characters.

Please rate this post, if it is useful for you.

Thanks & Regards
Ashok



Author: Varun Bansal    03 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

try to this url:

http://searchsqlserver.techtarget.com/tip/0,289483,sid87_gci1266201,00.html

Regards
Varun bansal
Do ot forget to Rate the post.....
Click here for visiting in my blogs



Author: shankar v    03 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

VARCHAR and NVARCHAR data types are both character data types that are variable-length.


Maximum Length - 8,000
Character Size - 1 byte

Maximum Length - 4,000
Character Size - 2 bytes

Regards & Thanks
Shankar V
www.teaminnovative.in



Author: Sharath Bengaluru    04 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi Friends,
Thank you very much to all...
I am storing comma separated numbers.
No special characters will be encountered..
so i think varchar is better option as u suggest...

Thanq all once again...

----
Please Rate my answer if it has found helpful to you.. Happy coding...



Author: Devendra    04 Jul 2009Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Dear,

Var char & Nvarchar both contains the same size that is
2^31-1 bytes

The basic Difference is Nvarchar is used for Unicode supportable while var char will use only plain English Language.

Thanks
dkmisra



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : Suggstion needed in code
Previous : Application not working fine in ie 8 and mozilla
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use