There are many tutorial articles about xml parsing with TSQL. For example, http://www.sqlserver.info/syntax/parse-xml-with-sql-server/
DECLARE @xml xml SET @xml = '<?xml version="1.0" encoding="UTF-8"?> <oo_outbound_order> <oo_master> <Code>123</Code> <Name>Branan</Name> </oo_master> </oo_outbound_order>' SELECT n.value('(./Code/text())[1]','int') as CODE , n.value('(./Name/text())[1]','Varchar(50)') as NAME FROM @xml.nodes('/oo_outbound_order/oo_master') as a(n)
Related Posts:
- Selecting COUNT(*) with DISTINCT
- What is a stored procedure?
- Self Join to get employee manager name
- How do I UPDATE from a SELECT in SQL Server?
- SQL query to select dates between two dates
- When should I use CROSS APPLY over INNER JOIN?
- How can I do an UPDATE statement with JOIN in SQL Server?
- How do I escape a single quote in SQL Server?
- T-SQL split string based on delimiter
- How do I escape a single quote in SQL Server?
- IDENTITY_INSERT is set to OFF – How to turn it ON?
- Column name or number of supplied values does not match table definition
- SQL Server FOR EACH Loop
- DateTime2 vs DateTime in SQL Server
- What is the equivalent of ‘describe table’ in SQL Server?
- Error converting data type varchar to float
- I want to use CASE statement to update some records in sql server 2005
- Conversion failed when converting the varchar value ‘simple, ‘ to data type int
- SELECT DISTINCT on one column
- Exclude a column using SELECT * [except columnA] FROM tableA?
- Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 4 (Year)
- TSQL PIVOT MULTIPLE COLUMNS
- SQL “select where not in subquery” returns no results
- Equivalent of Oracle’s RowID in SQL Server
- Is it possible to specify condition in Count()?
- SQL Server dynamic PIVOT query?
- Error converting data type varchar
- Temporary table in SQL server causing ‘ There is already an object named’ error
- I want to use CASE statement to update some records in sql server 2005
- How to calculate age (in years) based on Date of Birth and getDate()
- ORDER BY items must appear in the select list if SELECT DISTINCT is specified
- Text was truncated or one or more characters had no match in the target code page including the primary key in an unpivot
- How can I group by date time column without taking time into consideration
- “select * into table” Will it work for inserting data into existing table
- SUM OVER PARTITION BY
- Update query using Subquery in Sql Server
- Varchar invalid for Sum operator
- Conversion failed when converting date and/or time from character string while inserting datetime
- Conversion failed when converting date and/or time from character string while inserting datetime
- Insert Data Into Temp Table with Query
- error, string or binary data would be truncated when trying to insert
- How to create Temp table with SELECT * INTO tempTable FROM CTE Query
- NOT IN vs NOT EXISTS
- Must declare the scalar variable
- T-SQL split string
- Efficiently convert rows to columns in sql server
- Nested select statement in SQL Server
- How do I perform an IF…THEN in an SQL SELECT?
- How Stuff and ‘For Xml Path’ work in SQL Server?
- SQL Server : Arithmetic overflow error converting expression to data type int
- How to calculate percentage with a SQL statement
- Inserting data into a temporary table
- Can a foreign key be NULL and/or duplicate?
- CREATE VIEW must be the only statement in the batch
- Difference between JOIN and INNER JOIN
- What is the meaning of the prefix N in T-SQL statements and when should I use it?
- The multi-part identifier could not be bound
- “CASE” statement within “WHERE” clause in SQL Server 2008
- Query error with ambiguous column name in SQL
- What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current()?
- Operand type clash: int is incompatible with date + The INSERT statement conflicted with the FOREIGN KEY constraint
- Find all tables containing column with specified name – MS SQL Server
- Difference between numeric, float and decimal in SQL Server
- SQL Server Insert if not exists
- SQL Server: Invalid Column Name
- The ALTER TABLE statement conflicted with the FOREIGN KEY constraint
- How can I get column names from a table in SQL Server?
- SQL Server reports ‘Invalid column name’, but the column is present and the query works through management studio
- SQL Server IF NOT EXISTS Usage?
- How do I query for all dates greater than a certain date in SQL Server?
- String or binary data would be truncated. The statement has been terminated
- Add a column with a default value to an existing table in SQL Server
- How to concatenate text from multiple rows into a single text string in SQL Server
- Count(*) vs Count(1) – SQL Server
- What represents a double in sql server?
- Must declare the scalar variable
- Microsoft OLE DB Provider for SQL Server error ‘80004005’
- Bulk load data conversion error (truncation)
- How to format a numeric column as phone number in SQL
- Subtract one day from datetime
- Get current year in TSQL
- SQL: IF clause within WHERE clause
- Can I use multiple “with”?
- Replacing NULL with 0 in a SQL server query
- Incorrect syntax near ”
- SQL Server: Make all UPPER case to Proper Case/Title Case
- How do I query for all dates greater than a certain date in SQL Server?
- Backup a single table with its data from a database in sql server 2008
- How to write a foreach in SQL Server?
- SQL Server “cannot perform an aggregate function on an expression containing an aggregate or a subquery”, but Sybase can
- Get everything after and before certain character in SQL Server
- Cannot create an instance of OLE DB provider Microsoft.Jet.OLEDB.4.0 for linked server null
- What are database constraints?
- Arithmetic overflow error converting varchar to data type numeric. ’10’ <= 9.00
- Inner Joining three tables
- INSERT VALUES WHERE NOT EXISTS
- Filter data based on date in sql
- How to implement LIMIT with SQL Server? [duplicate]
- Cannot insert explicit value for identity column in table ‘table’ when IDENTITY_INSERT is set to OFF
- How to dump a Microsoft SQL Server database to a SQL script?