Link to home
Start Free TrialLog in
Avatar of leonstryker
leonstrykerFlag for United States of America

asked on

Error Number (515) Severity (16) State (3)

Error Number (515) Severity (16) State (3)

"Attempt to insert NULL value into column 'ActualByPort', table '#tmp'; column does not allow nulls. Update fails.Command has been aborted."


We re getting this error on both our development and production boxes, but on production the job continues and finishes.  On development it does not.

Can someone explain this behaivor? Why does it finish in production?
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

{wild guess}  
Figure out if you're supposed to allow nulls there
Check the #tmp table declaration in your dev box, and make sure it reflects what you want.
Then see what's populating it.
Avatar of leonstryker

ASKER

The temp table is created by a Select Into method and the data between machines is replicated.
SOLUTION
Avatar of Joe Woodhouse
Joe Woodhouse

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks Joe, but I found no such differences. It is a bit strange. I fixed the code using the IsNull, so teh issue is no longer there, but its still nagging at me.
Avatar of Joe Woodhouse
Joe Woodhouse

Hmm!

Unless there are, say, differences in ASE version (which I assume you've checked), yeah, I'm scratching my head now too!
Hi,

Do you have different traceon flags set
1) in the run files
2) set after the servers have each started

knel
knel,

Sorry, but I do not have the ability to check this any longer. Could you expand on your answer?  Have you seen such a thing happening?

Leon
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Easier solution - avoid temp tables and always define your temp tables up front:

create proc do_something
as

create table #blah
(
something_name     varchar(100) not null,
something_date       datetime not null,
something_notes      varchar(255) null
)

insert #blah
(something_name, something_date)
select etc...


This will give you more control and more predictable results.  It will also make debugging easier as you will have described the table definition explicitly rather than inferring it from a select/into.

David
Yes, except select into is much faster.

Leon
Thanks for everyone's help. Like I said its out of my hands now, but  I would suspect the answer is check everything.

Leon