How do I insert values from an XML document into a temp table, in SQL Server? -


An SP with Iam for which the input is an XML document I want to insert values ​​from XML into a temporary table. How can I apply it ...?

  create table [dbo]. [MyTable] ([A] [int] neul, [b] [warehouse] (50) faucet, [c] [datite] tap); DECLARE @p_xml XML SET @p_xml = '& lt; Root & gt; & Lt; Table a = "123" & gt; & Lt; P & gt; ABC & lt; / P & gt; & Lt; C & gt; 2009-10-20 & lt; / C & gt; & Lt; / Table & gt; & Lt; / Root & gt; Include in 'MyTable (A, B, C) SELECT x.mytable.value (' @ [1] ',' INT '), x.mytable.value (' b [1] ',' VARCHAR '), Mytable.value ('c [1]', 'DATETIME') from X  
@ p_xml.nodes ('/ / root / table' )

Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -