C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Diff between vachar and nvarchat


Posted Date: 18 Mar 2008      Total Responses: 6

Posted By: kiran kumar reddy       Member Level: Gold     Points: 2


Diff between vachar and nvarchat



Responses

Author: nikunj goswami    18 Mar 2008Member Level: SilverRating:     Points: 2
"nvarchar" can store unicode characters.

the maximum size of "nvarchar" is 4000 characters, where as it's 8000 characters for "varchar"


Thanks from :-
http://allaboutaspdotnet.page.tl/SQLServer-with--.-Net.htm


Author: Kalyan    18 Mar 2008Member Level: GoldRating:     Points: 2
nvarchar takes -Unicode data.

Varchar takes-ASCII data.

You can store image file name in varchar datatype.
and to store image make a folder within your project file and store the images using server.mappath() and uploaded.saveas() method.



Author: MuniHemadriBabu.Jogi    18 Mar 2008Member Level: GoldRating:     Points: 2
SQL Server provides both datatypes to store character information. For the most part the two datatypes are identical in how you would work with them within SQL Server or from an application. The difference is that nvarchar is used to store unicode data, which is used to store multilingual data in your database tables. Other languages have an extended set of character codes that need to be saved and this datatype allows for this extension. If your database will not be storing multilingual data you should use the varchar datatype instead.


Author: vinoth kumar    18 Mar 2008Member Level: SilverRating:     Points: 2
the main difference between the two is by using nvarchar we can reuse the space..

it means suppose if you use nvarchar(20). but you need only 10 char. then the remining 10 char will remains waste in varchar. but if you use nvarchar you can overcome from this drawback.


Author: Balthazor    18 Mar 2008Member Level: DiamondRating:     Points: 2
nvarchar takes -Unicode data.

Varchar takes-ASCII data.


Author: UltimateRengan    30 Jul 2008Member Level: DiamondRating:     Points: 1
The broad range of data types in SQL Server can sometimes throw people through a loop, especially when the data types seem to be highly interchangeable. Two in particular that constantly spark questions are VARCHAR and NVARCHAR: what's the difference between the two, and how important is the difference?

VARCHAR is an abbreviation for variable-length character string. It's a string of text characters that can be as large as the page size for the database table holding the column in question. The size for a table page is 8,196 bytes, and no one row in a table can be more than 8,060 characters. This in turn limits the maximum size of a VARCHAR to 8,000 bytes.

The "N" in NVARCHAR means uNicode. Essentially, NVARCHAR is nothing more than a VARCHAR that supports two-byte characters. The most common use for this sort of thing is to store character data that is a mixture of English and non-English symbols — in my case, English and Japanese.

One fairly major change to both VARCHAR and NVARCHAR in SQL Server 2005 is the creation of the VARCHAR(MAX) and NVARCHAR(MAX) data types. If you create a VARCHAR(MAX) column, it can hold up to 2^31 bytes of data, or 2,147,483,648 characters; NVARCHAR(MAX) can hold 2^30 bytes, or 1,073,741,823 characters.

These new data types are essentially replacements for the Large Object or LOB data types such as TEXT and NTEXT, which have a lot of restrictions. They can't be passed as variables in a stored procedure, for instance. The (MAX) types don't have those restrictions; they just work like very large string types. Consequently, if you're in the process of re-engineering an existing data design for SQL Server 2005, it might make sense to migrate some (although not all!) TEXT / NTEXT fields to VARCHAR(MAX) / NVARCHAR(MAX) types when appropriate.

The big difference between VARCHAR and NVARCHAR is a matter of need. If you need Unicode support for a given data type, either now or soon enough, go with NVARCHAR. If you're sticking with 8-bit data for design or storage reasons, go with VARCHAR. Note that you can always migrate from VARCHAR to NVARCHAR at the cost of some room -- but you can't go the other way 'round. Also, because NVARCHAR involves fetching that much more data, it may prove to be slower depending on how many table pages must be retrieved for any given operation

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


Post Reply
You must Sign In to post a response.
Next : How to create variables in web.config file. how to use that variables in codebehind file. explain cl
Previous : how to store flash videos in to the server using asp.net
Return to Discussion Forum
Post New Message
Category: .NET

Related Messages



dotNet Slackers   BizTalk Adaptors    Web Design

it help desk

Contact Us    Privacy Policy    Terms Of Use