SQL Server Text Datatype Maxlength = 65,535?

前端 未结 5 1818
忘掉有多难
忘掉有多难 2020-12-10 16:32

Software I\'m working with uses a text field to store XML. From my searches online, the text datatype is supposed to hold 2^31 - 1 characters. Currently SQL Server is trunca

5条回答
  •  忘掉有多难
    2020-12-10 16:55

    MSSQL 2000 should allow up to 2^31 - 1 characters (non unicode) in a text field, which is over 2 billion. Don't know what's causing this limitation but you might wanna try using varchar(max) or nvarchar(max). These store as many characters but allow also the regular string T-SQL functions (like LEN, SUBSTRING, REPLACE, RTRIM,...).

提交回复
热议问题