ERROR WHILE INSERT VALUE IN TABLE.

john rob

Total Post:108

Points:756
Posted by  john rob
 1534  View(s)
Ratings:
Rate this:
 when i insert any value in table when a error generated 
my table:
create table customer
(
id int primary key,
f_name varchar,
l_name varchar,
age int
)

insert Query:
insert into customer values(1,'John','Rob',22)

Error:

Msg 8152, Level 16, State 14, Line 1
String or binary data would be truncated.
The statement has been terminated.
 help me anybody.



  1. Vijay Shukla

    Post:100

    Points:700
    Re: Error while insert value in table.

    You can just alter your table with this below code:

    create table customer
    (
    id int primary key,
    f_name varchar(50),
    l_name varchar(50),
    age int
    )

  1. Shankar M

    Post:25

    Points:175
    Re: Error while insert value in table.

    Hi John,


    The Error Message says that the values that you are trying to insert to the column specified has exceeded the column length. Alter your table structure and try working it.

    Thanks,
    Shankar

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!