leonstryker
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?
"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?
ASKER
The temp table is created by a Select Into method and the data between machines is replicated.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
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.
Hmm!
Unless there are, say, differences in ASE version (which I assume you've checked), yeah, I'm scratching my head now too!
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
Do you have different traceon flags set
1) in the run files
2) set after the servers have each started
knel
ASKER
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
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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
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
ASKER
Yes, except select into is much faster.
Leon
Leon
ASKER
Thanks for everyone's help. Like I said its out of my hands now, but I would suspect the answer is check everything.
Leon
Leon
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.