cannot insert the value NULL into column 'field1'

Hi, Experts,
When I issued the following command
UPDATE tab1 SET field1=(SELECT fstreet FROM tab2)  

I got the error "cannot insert the value NULL into column 'field1'"
The table structures are built by a commercial ERP so they cannot be changed. How can I do?
CastlewoodAsked:
Who is Participating?
 
chapmandewConnect With a Mentor Commented:
UPDATE tab1 SET field1= ISNULL((SELECT fstreet FROM tab2)  , '')
0
 
Aneesh RetnakaranDatabase AdministratorCommented:
seems like Field1 wont allow nulls


UPDATE tab1 SET field1=(SELECT top 1 fstreet FROM tab2 where fstreet is not null )  
0
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.

All Courses

From novice to tech pro — start learning today.