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
cfsatxAsked:
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 ?
0
cfsatxAuthor Commented:
I get the same message even in the SQL query analyzer
0
gdemariaCommented:
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')

and

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



0

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
Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

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

Yep. You can compare the sizes reported by metadata views

SELECT *
FROM    INFORMATION_SCHEMA.COLUMNS
WHERE  TABLE_NAME = 'correlated_events'
0
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'
0
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
0
gdemariaCommented:
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
0
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.