Click here to Skip to main content
14,301,066 members
Rate this:
Please Sign up or sign in to 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

Rate this:
Please Sign up or sign in to vote.

Solution 1

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.
   
v2

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100