(Note) how to judge whether the database field is not null or not ""

Source: Internet
Author: User
Now, I want to update the records with all departments empty to the manufacturing department, whose language is updateuserlistsetdept. The manufacturing department wheredept. However, I am prompted to make 0 records, and check that the records are not updated, I don't know what the empty record represents in SQL. I cannot use the field name null !!!

Now I want to update all records with empty departments to 'manufacturing amount'. The syntax is update userlist set dept = 'manufacturing amount' where dept = '', but 0 records are prompted, the record is not updated. I do not know what the empty record is represented in SQL. I cannot use field name = null !!! ========================================

Now I want to update all records with empty departments to 'manufacturing amount'. The syntax is update userlist set dept = 'manufacturing amount' where dept = '', but 0 records are prompted, the record is not updated. I do not know what the empty record is represented in SQL. I cannot use field name = null !!!

========================================================== ========================================================== ==========
Where dept is null

========================================================== ========================================================== ==========
It is usually determined in the program,
Null is also a special value in MSSQL. It can only be determined by is null or is not null,
Not empty, simple. <> ''.
.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.