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. Storing RTF in SQL

Storing RTF in SQL

Scheduled Pinned Locked Moved Database
databasehelp
4 Posts 2 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
    MartyK2007
    wrote on last edited by
    #1

    hello, I need to store RTF (from a net richtext boxes RTF property) on an SQL table. The size could be anything up to 16 or 17 Mb. Whats the best datatype to use and has anyone got a codesnippet that could help. if its something like binary then is it possible that I can search the field with a standard SQL statement such as in: Select * where Fld Like "*Stuff to Find*" Thanks in advance Martin

    life is a bowl of cherries go on take a byte

    C 1 Reply Last reply
    0
    • M MartyK2007

      hello, I need to store RTF (from a net richtext boxes RTF property) on an SQL table. The size could be anything up to 16 or 17 Mb. Whats the best datatype to use and has anyone got a codesnippet that could help. if its something like binary then is it possible that I can search the field with a standard SQL statement such as in: Select * where Fld Like "*Stuff to Find*" Thanks in advance Martin

      life is a bowl of cherries go on take a byte

      C Offline
      C Offline
      Colin Angus Mackay
      wrote on last edited by
      #2

      MartyK2007 wrote:

      Whats the best datatype to use and has anyone got a codesnippet that could help.

      If SQL Server 2000 then IMAGE If SQL Server 2005 then VARBINARY(MAX) Since RTF is contains text only with some crazy formatting instructions embedded in the text then you can also use TEXT, NTEXT, VARCHAR(MAX) or NVARCHAR(MAX). The latter two in SQL Server 2005.

      MartyK2007 wrote:

      if its something like binary then is it possible that I can search the field with a standard SQL statement such as in: Select * where Fld Like "*Stuff to Find*"

      I would look at Full text indexing for something like that.


      Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

      M 1 Reply Last reply
      0
      • C Colin Angus Mackay

        MartyK2007 wrote:

        Whats the best datatype to use and has anyone got a codesnippet that could help.

        If SQL Server 2000 then IMAGE If SQL Server 2005 then VARBINARY(MAX) Since RTF is contains text only with some crazy formatting instructions embedded in the text then you can also use TEXT, NTEXT, VARCHAR(MAX) or NVARCHAR(MAX). The latter two in SQL Server 2005.

        MartyK2007 wrote:

        if its something like binary then is it possible that I can search the field with a standard SQL statement such as in: Select * where Fld Like "*Stuff to Find*"

        I would look at Full text indexing for something like that.


        Upcoming FREE developer events: * Glasgow: db4o: An Embeddable Database Engine for Object-Oriented Environments, Mock Objects, SQL Server CLR Integration, Reporting Services ... My website

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

        dont I have to specify a MAX value though for VARBINARY(MAX) I wouldnt want to restrict the size if possible (other than database size limits of course) thanks Martin

        life is a bowl of cherries go on take a byte

        M 1 Reply Last reply
        0
        • M MartyK2007

          dont I have to specify a MAX value though for VARBINARY(MAX) I wouldnt want to restrict the size if possible (other than database size limits of course) thanks Martin

          life is a bowl of cherries go on take a byte

          M Offline
          M Offline
          MartyK2007
          wrote on last edited by
          #4

          ok stupid question - just googled VARBINARY(MAX) thanks for that it seems to fit what I neeed Martin

          life is a bowl of cherries go on take a byte

          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