String or binary data would be truncated

insert into correlated_events(ce_id,ce_status) values('CE003998','Initiated')

I get String or binary data would be truncated

ce_id is varchar(50) and ce_status is varchar(50)

ce_id is the primary key
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cfsatxAuthor Commented:
Same query works fine my test database and not in production database. Any help ?
cfsatxAuthor Commented:
I get the same message even in the SQL query analyzer
I would suspect that either your production database has a different size or there is a trigger firing onto another table or a default value populating.

Try putting this into SQL analyzer...

insert into correlated_events(ce_id,ce_status) values('a','x')

if that works try this..

insert into correlated_events(ce_id,ce_status) values('CE003998','x')


insert into correlated_events(ce_id,ce_status) values('x','Initiated')

in order to figure out which field is the problem, if either of them

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Exploring ASP.NET Core: Fundamentals

Learn to build web apps and services, IoT apps, and mobile backends by covering the fundamentals of ASP.NET Core and  exploring the core foundations for app libraries.

> I would suspect that either your production database has a different size

Yep. You can compare the sizes reported by metadata views

WHERE  TABLE_NAME = 'correlated_events'
cfsatxAuthor Commented:
The issue was related to a constraint having a default value of "N instead of 'N' .

Got resolved once we made it to 'N'
cfsatxAuthor Commented:
I've requested that this question be closed as follows:

Accepted answer: 0 points for cfsatx's comment http:/Q_27505100.html#37323206

for the following reason:

Watch out for proper default values in fields
My comment 37322815 suggested checking default values.    You can accept your answer as part of the solution, but I believe you should also give me credit for the answer
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ColdFusion Language

From novice to tech pro — start learning today.