Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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)
);
Posted
Updated 17-Mar-19 20:43pm

1 solution

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.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900