home / software / tips and tricks / How to create XML Data using T-SQL

How to create XML Data using T-SQL

Updated:  10/15/2011 04:10 AM
Author:  Shiju Mathews

Status:    Resolved.


It is easy to create xml data using T-SQL. Consider the following example.

create XML Data using T-SQL

Use the T-SQL Script to generate above XML:



To create xml from the table called "tblState", using columns names as element, use the following sql

Tags: How to create XML Data using T-SQL
Updated on: March 2024