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

x
  • 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?
0
Castlewood
Asked:
Castlewood
1 Solution
 
chapmandewCommented:
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

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