Search
 
SCRIPT & CODE EXAMPLE
 

SQL

how to get node value of xml in sql server

CREATE TABLE test(data xml);
insert into test values
('
<ROOT>
  <Customer>
    <Order>Order 1</Order>
  </Customer>
  <Customer>
    <Order>Order 2</Order>
  </Customer>
</ROOT>');
GO
-- If you need first <Order> element of your XML data you can use the next sentence.
SELECT data.value('(ROOT/Customer/Order)[1]', 'varchar(100)')
FROM   test;

-- all values
SELECT T2.lin.value('(Order)[1]', 'varchar(100)')
FROM   test
CROSS APPLY data.nodes('/ROOT/Customer') as T2(lin)
Comment

PREVIOUS NEXT
Code Example
Sql :: update top 100 order by sql server 
Sql :: Provera dupliranih konatakata 
Sql :: oracle alter database open restricted session 
Sql :: postgres add column at position 
Sql :: declare table temporary sql server 
Sql :: sql equal then arrow 
Sql :: providername system.data. mysql 
Sql :: sql server select query datatype 
Sql :: how to input data as id in database sql c# 
Sql :: laravel error SQLSTATE[HY000] [2002] Nenhuma ligação pôde ser feita porque o computador de destino as recusou ativamente 
Sql :: Patch Applied to the Oracle Database 
Sql :: oracle test if 0 
Sql :: Uncomment listen_address=localhost 
Sql :: child row: a foreign key constraint fails 
Sql :: row = 1 oracle sql 
Sql :: how much table store postgres 
Sql :: linq to sql converter online 
Sql :: mysql update sequence with order by 
Sql :: syntac for creating view in dbbrowser 
Sql :: grant privileges when craeting a user 
Sql :: php mysql set db collation 
Sql :: how to make letter id primary key in mysql 
Sql :: postgres audit table 
Sql :: how to make full text search dynamic in mysql 
Sql :: how to take recent row without limit in mysql 
Sql :: What is performance wise better join or a subquery ? 
Sql :: SQL Query Orderby Two or More Columns and by number of characters 
Sql :: ltrim entire column sql select query 
Sql :: sql or operator 
Sql :: SQLAlchemy query to return only n results? 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =