[Last Call] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 403
  • Last Modified:

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?
1 Solution
UPDATE tab1 SET field1= ISNULL((SELECT fstreet FROM tab2)  , '')
Aneesh RetnakaranDatabase AdministratorCommented:
seems like Field1 wont allow nulls

UPDATE tab1 SET field1=(SELECT top 1 fstreet FROM tab2 where fstreet is not null )  

Featured Post

Rewarding opportunities for women in IT

Across the nation, technology jobs are vacant because there aren’t enough qualified professionals to fill them. With a degree from WGU, you can get the credentials it takes to become an in-demand IT professional. Plus, WGU’s IT programs include industry certifications.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now