Notitie
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen u aan te melden of de directory te wijzigen.
Voor toegang tot deze pagina is autorisatie vereist. U kunt proberen de mappen te wijzigen.
van toepassing op:SQL Server
Azure SQL Database
Azure SQL Managed Instance
SQL-database in Microsoft Fabric
Als de instructie is ingesteld op CDATA, worden de ingesloten gegevens niet gecodeerd, maar in de sectie CDATA geplaatst. De CDATA-kenmerken moeten naamloos zijn.
De volgende query verpakt de beschrijving van het productmodeloverzicht in een CDATA-sectie.
USE AdventureWorks2022;
GO
SELECT 1 as Tag,
0 as Parent,
ProductModelID as [ProductModel!1!ProdModelID],
Name as [ProductModel!1!Name],
'<Summary>This is summary description</Summary>'
as [ProductModel!1!!CDATA] -- no attribute name so ELEMENT assumed
FROM Production.ProductModel
WHERE ProductModelID = 19
FOR XML EXPLICIT;
Dit is het resultaat:
<ProductModel ProdModelID="19" Name="Mountain-100">
<![CDATA[<Summary>This is summary description</Summary>]]>
</ProductModel>