What is the best way to store a large amount of text in a SQL server table?

前端 未结 8 477
日久生厌
日久生厌 2020-12-15 15:19

What is the best way to store a large amount of text in a table in SQL server?

Is varchar(max) reliable?

相关标签:
8条回答
  • 2020-12-15 15:54

    According to the text found here, varbinary(max) is the way to go. You'll be able to store approximately 2GB of data.

    0 讨论(0)
  • 2020-12-15 16:06

    Split the text into chunks that your database can actually handle. And, put the split up text in another table. Use the id from the text_chunk table as text_chunk_id in your original table. You might want another column in your table to keep text that fits within your largest text data type.

    CREATE TABLE text_chunk (
         id NUMBER,
         chunk_sequence NUMBER,
         text BIGTEXT)
    
    0 讨论(0)
提交回复
热议问题