What is the canonical way to store arbitrary (possibly tagged) text in SQL?

What is wiki / stackoverflow / etc. do when it comes to storing text? Is text broken for newlines? Does it break into pieces of fixed length? What is the best way to store arbitrarily long pieces of text?

+3
source share
8 answers

nvarchar (max) ftw. because simple things that are too complicated are bad, mmkay?

+9
source

I assume that if you need to provide the ability to store large fragments of text, and you do not mind that you cannot look too much into their contents when prompted, you can use CLob.

+2
source

, , . , - , , /, . , , .

, RDBMS, , ( varchar (max)). , .

+1

PostgreSQL - BYTEA. , .

+1

, , "" , , , , - db .

.

0

, StackOverflow "" . , UTF8 ( UTF16 - . , SQL Server, ).

, " " . , , , , (, Markdown, HTML, "" )

0

, , , , ..

, SQL Server, , . SQL Server 2005 nvarchar (max) . , / , , StackOverflow.com.

. , .

, , , . HTML, , .

, , , Unicode UTF-8 . . . , , ASCII , ..

0

SQL Server:

varchar (max) . , 2 .

. , . .Net SqlCommand LinqToSQL ( SqlCommand ).

0

Source: https://habr.com/ru/post/1697150/


All Articles