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

前端 未结 8 466
日久生厌
日久生厌 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 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)
    

提交回复
热议问题