Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Add JSON"Valuetypes to XML Nodes using SQL
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
---Fake tables in Stored procedure1 create table #Cdetails(cid int, name varchar(5), age int) insert into #Cdetails values(1001,'John',12), (1002,'Rick',19), (1003,'Diane',25), (1004,'Kippy',26) --Output of Stored procedure create table #final(xml_data xml) insert into #final select XML_data = (select ID = cd1.cid, details = ( select cd.name, cd.age from #Cdetails cd where cd.cid = cd1.cid For XML Path(''), Type) from #Cdetails cd1 For XML Path('Main')); ;WITH XMLNAMESPACES ('http://www.samplenamespace.com/json' as json) select * from #final For XML Path('Main') drop table #Cdetails,#final
View schema
Execution time: 0,02 sec, rows selected: 1, rows affected: 5, absolute service time: 0,17 sec
edit mode
|
history
|
discussion