FOR JSON 如何逸出特殊字元和控制字元 | json跳脫雙引號
本文內容 適用於:SQLServerAzureSQLDatabaseAzureSynapseAnalytics(SQLDW)平行處理資料倉儲APPLIESTO:SQLServerAzureSQLDatabaseAzureSynapseAnalytics(SQLDW)ParallelDataWarehouse本主題描述SQLServerSELECT陳述式的FORJSON子句如何逸出特殊字元,並在JSON輸出中代表控制字元。ThistopicdescribeshowtheFORJSONclauseofaSQLServerSELECTstatementescapesspecialcharactersandrepresentscontrolcharactersintheJSONoutput.重要此頁面描述MicrosoftSQLServer中的內建JSON支援。Thispagedescribesthebuilt-insupportfor...
本文內容適用於: SQL ServerAzure SQL DatabaseAzure Synapse Analytics (SQL DW)平行處理資料倉儲APPLIES TO: SQL Server Azure SQL Database Azure Synapse Analytics (SQL DW) Parallel Data Warehouse
本主題描述 SQL Server SELECT 陳述式的 FOR JSON 子句如何逸出特殊字元,並在 JSON 輸出中代表控制字元。This topic describes how the FOR JSON clause of a SQL Server SELECT statement escapes special characters and represents control characters in the JSON output.
重要
此頁面描述 Microsoft SQL Server 中的內建 JSON 支援。This page describes the built-in support for JSON in Microsoft SQL Server. 如需 JSON 中逸出和編碼的一般資訊,請參閱 JSON RFC 的第 2.5 節 - https://www.ietf.org/rfc/rfc4627.txt[1]。For general info about escaping and encoding in JSON, see Section 2.5 of the JSON RFC - https://www.ietf.org/rfc/rfc4627.txt[2].
逸出特殊字元Escaping of special characters如果來源資料包含特殊字元,FOR JSON 子句會以 逸出 JSON 輸出中的這些字元,如下表所示。If the source data contains special characters, the FOR JSON clause escapes them in the JSON output with , as sh...