Click here to Skip to main content
15,903,388 members
Please Sign up or sign in to vote.
1.00/5 (3 votes)
See more:
WHAT IS THE DIFFREENCE BETWEEN CHAR AND VARCHAR DATA TYPE
Posted

 
Share this answer
 
 
Share this answer
 
This is a case where the naming causes confusion. You would expect, from the name, that the char datatype was used to store an individual character. What it does, however, is allocate a fixed size for storing a string. So, if you allocated 8000 character storage and only stored 1 character in it, you would waste the other 7999 characters. VarChar is different in that it only allocates as many characters as are needed. Where things get fun is if you update a VarChar - SQL Server can allocate the new part of the string so that it's non-contiguous with the initial part of the string.
 
Share this answer
 
please read the link...

http://www.codeproject.com/Tips/272532/Difference-between-Sql-Server-Char-and-Varchar-Dat..


please see this also... [^]
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900