我正在使用包含大量数据的sql server 2010。我在更新其中一个字段中某个字段的siz时遇到错误。
code
CREATE TABLE [dbo].[Ayyat_Translation_Language_old_20131209] (
[Ayat_Translation_Language_ID] INT IDENTITY (1, 1) NOT NULL,
[Translation_Laanguage_ID] INT NULL,
[Juz_ID] INT NULL,
[Surah_ID] INT NOT NULL,
[Ayat_Description] NVARCHAR (3900) COLLATE Arabic_CI_AI_KS_WS NOT NULL,
[Ayat_No] INT NULL,
PRIMARY KEY CLUSTERED ([Ayat_Translation_Language_ID] ASC),
CONSTRAINT [fkey2] FOREIGN KEY ([Translation_Laanguage_ID]) REFERENCES [dbo].[Translation_Language] ([TransLation_Language_ID]) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT [fkey0] FOREIGN KEY ([Juz_ID]) REFERENCES [dbo].[Juz] ([Juz_ID]),
CONSTRAINT [fkey1] FOREIGN KEY ([Surah_ID]) REFERENCES [dbo].[Surah] ([Surah_ID]) ON DELETE CASCADE ON UPDATE CASCADE
);
当我尝试将[Ayat_Description]
的大小从3900更改为5000时,它会显示随机错误。如何解决?
答案 0 :(得分:2)
nvarchar [ ( n | max ) ]
可变长度的Unicode字符串数据。 n定义字符串长度,可以是1到4,000之间的值。 max表示最大存储大小为2 ^ 31-1个字节(2 GB)。存储大小(以字节为单位)是输入数据的实际长度的两倍+ 2个字节。
如果您需要存储超过4000个字符
,则需要输入4000或最大值