--- title: "SQL XML column values" description: "Demonstrates how to retrieve and work with XML data retrieved from SQL Server." ms.date: "08/15/2019" dev_langs: - "csharp" ms.assetid: d97ce4da-f09c-4d1e-85b7-a0ccedd7246a ms.prod: sql ms.prod_service: connectivity ms.technology: connectivity ms.topic: conceptual author: David-Engel ms.author: v-daenge ms.reviewer: v-kaywon --- # SQL XML column values [!INCLUDE[Driver_ADONET_Download](../../../includes/driver_adonet_download.md)] SQL Server supports the `xml` data type, and developers can retrieve result sets including this type using standard behavior of the class. An `xml` column can be retrieved just as any column is retrieved (into a , for example) but if you want to work with the content of the column as XML, you must use an . ## Example The following console application selects two rows, each containing an `xml` column, from the **Sales.Store** table in the **AdventureWorks** database to a instance. For each row, the value of the `xml` column is read using the method of . The value is stored in an . Note that you must use rather than the method if you want to set the contents to a variable; returns the value of the `xml` column as a string. > [!NOTE] > The **AdventureWorks** sample database is not installed by default when you install SQL Server. You can install it by running SQL Server Setup. [!code-csharp [SqlDataReader_GetSqlXml#1](~/../sqlclient/doc/samples/SqlDataReader_GetSqlXml.cs#1)] ## Next steps - - [XML data in SQL Server](xml-data-sql-server.md)