Chaitanya Lakshmi
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook
  • About Me
  • Job Duties
  • Knowledge Blog
  • Applications
  • Contact Us
    • Linked In
    • Facebook

What is the difference between char and varchar data types?

2/17/2012

1 Comment

 
Set char to occupy n bytes and it will take n bytes even if we are
storing a value of n-m bytes

Set varchar to occupy n bytes and it will take only the required space
and will not use the n bytes

Eg: name char(15) will waste 10 bytes if we store ‘mizan’, if each char
takes a byte
Eg: name varchar(15) will just use 5 bytes if we store ‘mizan’, if each
char takes a byte. rest 10 bytes will be free.
1 Comment
Ganesh
2/16/2012 07:37:08 pm

Nice to have this note. Thanks for the author.

Reply



Leave a Reply.

    Archives

    April 2012
    March 2012
    February 2012

    Categor

    All
    Ajax
    Api
    Cross Site Scripting
    Css
    Curl
    Design Patterns
    Drupal
    Exception Handling
    Htaccess
    Html
    Javascript
    Jquery
    Json
    Linux
    Mysql
    Oops
    Php
    Regular Expressions
    Web 2.0
    Webservices
    Wordpress
    Xhtml

    RSS Feed

Powered by Create your own unique website with customizable templates.