SQL Server add single quotation marks

Source: Internet
Author: User

The use of "'" (single quotation marks): In SQL Server, two "'" (single quotation marks) in the case of stitching strings, that is, the concatenation of a "'" single quote string.

SELECT TOP 1 " '"+CONVERT(nvarchar( -), keyID)+" '"Name1 fromRel_productstocklock with(NOLOCK)WHEREKeyId is  not NULLSELECT TOP 1 " '"+CONVERT(nvarchar( -), keyID)+" ",'Name2 fromRel_productstocklock with(NOLOCK)WHEREKeyId is  not NULLSELECT " '"Name3;SELECT '123" "Name4;SELECT '123'+"'Name5;SELECT  '"123"'Name6;SELECT TOP 1 '123'+AreaName Name7 fromdbo. Dim_area;SELECT TOP 1 '123" "+AreaName Name8 fromdbo. Dim_area;SELECT TOP 1 '123" "+AreaName+"'Name9 fromdbo. Dim_area;SELECT TOP 1 '123" "+AreaName+" '"Name10 fromDbo. Dim_area;

https://www.cnblogs.com/zhaosw/p/6088040.html questions about SQL stitching strings

SQL Server add single quotation marks

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.