String or binary data would be truncated IN SQL Server Management Studio -
i have following table:
create table zain ( zid int not null, cid varchar(2) not null, name nvarchar(50)null, hiredate date null ) when execute following insert statement error:
insert zain values('12', 'asd', 'hohoo', 'jan-10-1999') the error is:
msg 8152, level 16, state 14, line 1
string or binary data truncated. statement has been terminated.
what doing wrong?
there issue insert statement
the column
zidint , passing 12 string '12' can remove'won't give error.the column
cidvarchar(2) , trying insert 3 character string'asd'give data truncation error. ie error herebut if fix above error 1 pop-up
conversion failed when converting date and/or time character string. date format giving hiredate column'jan-10-1999'. sql can take date format in mm/dd/yyyy or yyyy-mm-dd etc. format specified cannot converted automatically date format sql. try 01/10/1999 or 1999-01-10..else try convert() function
Comments
Post a Comment