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(max)(To Be Or Not To Be)

nvarchar(max)(To Be Or Not To Be)

Scheduled Pinned Locked Moved Database
question
5 Posts 5 Posters 1 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
    moein serpico
    wrote on last edited by
    #1

    when i should use nvarchar(max) type and when not?

    C J P D 4 Replies Last reply
    0
    • M moein serpico

      when i should use nvarchar(max) type and when not?

      C Offline
      C Offline
      Chris Meech
      wrote on last edited by
      #2

      I can't say when to use or not, but this link[^] should help with explaining the differences. :)

      Chris Meech I am Canadian. [heard in a local bar] In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]

      1 Reply Last reply
      0
      • M moein serpico

        when i should use nvarchar(max) type and when not?

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

        An nvarchar column can stores unicode data but requires twice the space compared to varchar. A varchar column is restricted to an 8-bit codepage and is therefore limited to one or a few alphabets/languages at a time. Codepage incompatabilities are a PITA, and Unicode is the cure for codepage problems. Normally you take a performance hit using nvarchar as it takes twice the space in both memory and disc. But if the client uses a different codepage than the server you might take a performance hit on the conversion of the varchar instead.

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

        1 Reply Last reply
        0
        • M moein serpico

          when i should use nvarchar(max) type and when not?

          P Offline
          P Offline
          PIEBALDconsult
          wrote on last edited by
          #4

          Use it for strings; not for numerical and temporal data. :-D

          1 Reply Last reply
          0
          • M moein serpico

            when i should use nvarchar(max) type and when not?

            D Offline
            D Offline
            David Skelly
            wrote on last edited by
            #5

            I don't really understand your question. Are you asking:

            • when should I use nvarchar instead of varchar?
            • when should I use nvarchar(max) instead of a specified size such as nvarchar(100)?
            • when should I use nvarchar(max) instead of ntext?
            • when should I use nvarchar(max) instead another datatype?
            • something else
            • all of the above

            These are all different questions (some of which have been answered already).

            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