Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. nvarchar vs varchar

nvarchar vs varchar

Scheduled Pinned Locked Moved Database
questionvisual-studio
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mike654321
    wrote on last edited by
    #1

    Sorry in advanced for a duplicate question or a really basic question, but is nvarchar better than varchar? Is there an advantage for nvarchar? I've always just used varchar. Thanks!

    J C 2 Replies Last reply
    0
    • M Mike654321

      Sorry in advanced for a duplicate question or a really basic question, but is nvarchar better than varchar? Is there an advantage for nvarchar? I've always just used varchar. Thanks!

      J Offline
      J Offline
      Jorgen Andersson
      wrote on last edited by
      #2

      Nvarchar stores unicode characters which means you don't have the problem with different codepages in different countries. But it also uses twice the space. If you need to store characters from several alphabets in the same field you really will like nvarchar.

      "When did ignorance become a point of view" - Dilbert

      M 1 Reply Last reply
      0
      • J Jorgen Andersson

        Nvarchar stores unicode characters which means you don't have the problem with different codepages in different countries. But it also uses twice the space. If you need to store characters from several alphabets in the same field you really will like nvarchar.

        "When did ignorance become a point of view" - Dilbert

        M Offline
        M Offline
        Mike654321
        wrote on last edited by
        #3

        multi language benefit, but space cost...got it, thanks!

        M 1 Reply Last reply
        0
        • M Mike654321

          multi language benefit, but space cost...got it, thanks!

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Heres another one, SQL Server CE ONLY supports nvarchar, nchar etc so if you need to use CE then you know the requirement. Also does not support stored procedures X| I am currently bleeding from this particular bite me!

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • M Mike654321

            Sorry in advanced for a duplicate question or a really basic question, but is nvarchar better than varchar? Is there an advantage for nvarchar? I've always just used varchar. Thanks!

            C Offline
            C Offline
            carlecomm
            wrote on last edited by
            #5

            VARCHAR is a variable length string of ASCII characters while NVARCHAR is a variable length string of UNICODE characters.Since NVARCHAR can handle unicode characters, so it allows to use multiple languages in the database. Each ASCII character takes one Byte of space while each UNICODE character takes two Bytes of space. It means NVARCHAR takes twice as much space to store to allow for the extended character set required by some other languages.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups