Text fields in SQL Server queries are returned as empty

Source: Internet
Author: User

There was a strange phenomenon in maintaining the system data last night. Clearly the database has data, the query result is returned to empty. This is the case, query the working table about the job description, the Chinese content to match the job Description field, where the matching content contains spaces.

Try to remove the contents after the first space and the query has the result. Plus one more space is gone. Either "=" or "like" match, there is no result.

Then, look at the Job Description field type, which is the nvarchar type. Remember, add n before the matching character.

SQL statement: SELECT * from the Weekday log table where job Description field =n ' content is customer fill in there is a space before, resulting in a null return result. Write n before matching field can be solved. ‘

Text fields in SQL Server queries are returned as empty

Related Article

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.