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. Cannot store 2000 characters in varchar(7000)

Cannot store 2000 characters in varchar(7000)

Scheduled Pinned Locked Moved Database
comhelpquestion
5 Posts 3 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.
  • D Offline
    D Offline
    Dinuj Nath
    wrote on last edited by
    #1

    Hi, I have some text which has a lot of newlines. I checked the amount of text in an editor. It showed about 2000 characters. When I tried to save this text in an varchar field of 7000 width an error was generated saying about character limit. Why is this happening? Is it due to the newline characters. Thanks - बुरा जो देखण मै चला, बुरा न िमलया कोय, जो मन खोजा आपणा तो मुझसे बुरा न कोय। Translation

    M A 2 Replies Last reply
    0
    • D Dinuj Nath

      Hi, I have some text which has a lot of newlines. I checked the amount of text in an editor. It showed about 2000 characters. When I tried to save this text in an varchar field of 7000 width an error was generated saying about character limit. Why is this happening? Is it due to the newline characters. Thanks - बुरा जो देखण मै चला, बुरा न िमलया कोय, जो मन खोजा आपणा तो मुझसे बुरा न कोय। Translation

      M Offline
      M Offline
      Michael P Butler
      wrote on last edited by
      #2

      Dinuj Nath wrote:

      Why is this happening? Is it due to the newline characters.

      Each newline character will count as one character, did you include this count in your original 2000. You may be better off with a ntext column rather than relying on a varchar Michael CP Blog [^] Development Blog [^]

      D 1 Reply Last reply
      0
      • M Michael P Butler

        Dinuj Nath wrote:

        Why is this happening? Is it due to the newline characters.

        Each newline character will count as one character, did you include this count in your original 2000. You may be better off with a ntext column rather than relying on a varchar Michael CP Blog [^] Development Blog [^]

        D Offline
        D Offline
        Dinuj Nath
        wrote on last edited by
        #3

        Thanks for the reply. The count is using the count characters util in scite editor and by the way there won't be more than 20 newline chars. I have been forced to use text and it is eating up space. I just can't understand why I just can't store some thousand simple chars in varchar(7000).

        1 Reply Last reply
        0
        • D Dinuj Nath

          Hi, I have some text which has a lot of newlines. I checked the amount of text in an editor. It showed about 2000 characters. When I tried to save this text in an varchar field of 7000 width an error was generated saying about character limit. Why is this happening? Is it due to the newline characters. Thanks - बुरा जो देखण मै चला, बुरा न िमलया कोय, जो मन खोजा आपणा तो मुझसे बुरा न कोय। Translation

          A Offline
          A Offline
          Arjan Einbu
          wrote on last edited by
          #4

          What version of SQL Server? If SQL 2000, is the row size within the page limit? In MS SQL Server versions prior to 2005, one row's data is limited to fit in one page or an 8kb block. (But the definition of a table can show a total of more than 8kb per row if you have one or more variable length columns.)

          D 1 Reply Last reply
          0
          • A Arjan Einbu

            What version of SQL Server? If SQL 2000, is the row size within the page limit? In MS SQL Server versions prior to 2005, one row's data is limited to fit in one page or an 8kb block. (But the definition of a table can show a total of more than 8kb per row if you have one or more variable length columns.)

            D Offline
            D Offline
            Dinuj Nath
            wrote on last edited by
            #5

            Thanks a lot. Its Sql Server 2000.

            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