当数据类型为 VARCHAR(MAX) 时,SQL Server 2008 数据库字段可以包含多少个字符?
最佳答案
来自http://msdn.microsoft.com/en-us/library/ms176089.aspx
varchar [ ( n | max ) ] Variable-length, non-Unicode character data. n can be a value from 1 through 8,000. max indicates that the maximum storage size is 2^31-1 bytes. The storage size is the actual length of data entered + 2 bytes. The data entered can be 0 characters in length. The ISO synonyms for varchar are char varying or character varying.
1 个字符 = 1 个字节。并且不要忘记 2 个字节作为终止符。因此,2^31-3 个字符。
关于sql-server-2008 - varchar(max) 有多少个字符?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1761124/