cannot insert the value NULL into column 'field1'

Posted on 2010-01-04
Last Modified: 2012-05-08
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?
Question by:Castlewood
    LVL 60

    Accepted Solution

    UPDATE tab1 SET field1= ISNULL((SELECT fstreet FROM tab2)  , '')
    LVL 75

    Expert Comment

    by:Aneesh Retnakaran
    seems like Field1 wont allow nulls

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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Quality of Service (QoS) options are nearly endless when it comes to networks today. This article is merely one example of how it can be handled in a hub-n-spoke design using a 3-tier configuration.
    I recently attended Cisco Live! in Las Vegas, a conference that boasted over 28,000 techies in attendance, and a week of hands-on learning hosted by a solid partner with which Concerto goes to market.  Every year, Cisco displays cutting-edge technol…
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now