字符串或二进制数据截断 [英] String or binary data truncate
问题描述
我尝试在表定义中插入少于字段的值,但我在'/'应用程序中遇到问题服务器错误。字符串或二进制数据将被截断。该声明已被终止。
我尝试过:
CREATE TABLE [dbo]。[treg](
[tid] BIGINT IDENTITY(101,1)NOT NULL,
[uname] NVARCHAR(35)NOT NULL,
[name] NCHAR(40)NOT NULL,
[mail] NVARCHAR(60)NOT NULL,
[addr] NVARCHAR(MAX) NOT NULL,
[photo] VARCHAR(MAX)NOT NULL,
[phone] NVARCHAR(15)NOT NULL,
[addrproof] VARCHAR(MAX)NOT NULL,
[exp] NCHAR(10)NOT NULL,
[类别] CHAR(30)NOT NULL,
PRIMARY KEY CLUSTERED([tid] ASC)
);
您输入的至少一个值不适合字段:我们无法看到您用于插入数据的代码,我们无法看到您的数据。因此,您需要使用调试器在代码运行时检查代码。
仔细检查每个字段并确保您尝试插入正确的数据,并将其插入到右侧列中
I tried to insert values less than the field in the table definition but I have a problem Server Error in '/' Application. String or binary data would be truncated. The statement has been terminated.
What I have tried:
CREATE TABLE [dbo].[treg] (
[tid] BIGINT IDENTITY (101, 1) NOT NULL,
[uname] NVARCHAR (35) NOT NULL,
[name] NCHAR (40) NOT NULL,
[mail] NVARCHAR (60) NOT NULL,
[addr] NVARCHAR (MAX) NOT NULL,
[photo] VARCHAR (MAX) NOT NULL,
[phone] NVARCHAR (15) NOT NULL,
[addrproof] VARCHAR (MAX) NOT NULL,
[exp] NCHAR (10) NOT NULL,
[category] CHAR (30) NOT NULL,
PRIMARY KEY CLUSTERED ([tid] ASC)
);
At least one of the values you are entering does not fit in the field: we can't see the code you are using to insert the data, and we cant see your data. So you need to use the debugger to examine your code while it is running.
Check each field carefully and make sure you are trying to insert the right data, and that it is being inserted to the right column.
这篇关于字符串或二进制数据截断的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!