What is the correct data type for text

  • I'm trying to set up a database for a bookshop to hold book reviews. Even though I've set the field size to 8,000 characters, I'm only able to fit 1,022 characters (from a word count done in Word)into the review field. I alsotried using the text data type, but was unable to fit any more in than with varchar. As I need to fit quite quite large reviews into the field, what is the best data type to use?

  • You'll probably want to use a text column. Are you including formatting chars in your char count? Normally you can get about 8k bytes per record as long as you're not using nvarchar - which reduces it to 4k or so.

    Andy

  • If you need to store very large texts into a database you can use a binary or varbinary

    column and cast your text from varchar to binary to insert or update and the reverse for select

  • How are you getting the data in there. If this is a word document you are dropping in the field, there is overhead from Word that includes non-printables.

    I'd go with text. as a writer, 8k ain't that much and we can easily exceed this.

    Steve Jones

    steve@dkranch.net

  • Thanks for the help guys, I appreciate it.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply