Quantcast
Channel: Microsoft SQL Server
Viewing all articles
Browse latest Browse all 4871

SQL error Msg 515 column does not allow NULL's. but there are no NULL's

$
0
0

I am hoping I have a simple issue, but I am not sure. I am trying to update the Salesperson ID field in Dynamics GP SOP table from the Salesperson ID in the Document table.

When I run the following query:

Update SOP30300

Set SOP30300.SLPRSNID = (Select RM00101.SLPRSNID From RM00101 left join RM20101 on RM20101.CUSTNMBR = RM00101.CUSTNMBR
WHERE RM20101.SLPRSNID is not null AND RM20101.DOCNUMBR like '5%' and RM20101.DOCNUMBR = SOP30300.SOPNUMBE)
Where SOP30300.SLPRSNID = ' '

I get:

Msg 515, Level 16, State 2, Line 1
Cannot insert the value NULL into column 'SLPRSNID', table 'GPTST.dbo.SOP30300'; column does not allow nulls. UPDATE fails.
The statement has been terminated.

A simpler version also produces the same results:

Update SOP30300

Set SOP30300.SLPRSNID = (Select RM20101.SLPRSNID From RM20101 WHERE RM20101.DOCNUMBR like '5%' and...


Viewing all articles
Browse latest Browse all 4871

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>