将XML格式的数据写入一个临时表

DECLARE @XML AS XML, @hDoc AS INT, @SQL NVARCHAR (MAX)  SELECT @XML = N'<Root><tblStockMovementHeader>
<intRowNum>1</intRowNum><intSourceCurrentRowVersion>78001</intSourceCurrentRowVersion><intSourceSysID>1007</intSourceSysID><intCurrentRowVersion>78001</intCurrentRowVersion><strSourceLocationCode>MYSH001</strSourceLocationCode><strSourceMachineCode>01</strSourceMachineCode><SysID>1007</SysID><MovementShopCode>MYSH001</MovementShopCode><MovementNo>AO00000003</MovementNo><MovementDate>2015-01-08T00:00:00</MovementDate><DocTypeCode>AO</DocTypeCode><MovementDirection>-1</MovementDirection><MovementStatus>NEW</MovementStatus><MovementVersion>1</MovementVersion><HandleVersion>0</HandleVersion><FromShop>MYSH001</FromShop><LocationCode>MYSH001</LocationCode><MachineCode>01</MachineCode><MarkDel>0</MarkDel><CurrentRowVersion>AAAAAAABMLE=</CurrentRowVersion><IsSource>1</IsSource><AllowPublishUp>1</AllowPublishUp><AllowPublishDown>1</AllowPublishDown><SourceTier>99</SourceTier><SourceLocationCode>MYSH001</SourceLocationCode><SourceMachineCode>01</SourceMachineCode><CreateDate>2015-01-08T15:39:00</CreateDate><CreateBy>admin</CreateBy><UpDateDate>2015-01-08T15:39:00</UpDateDate><UpDateBy>admin</UpDateBy></tblStockMovementHeader><tblStockMovementHeader>
<intRowNum>2</intRowNum><intSourceCurrentRowVersion>78046</intSourceCurrentRowVersion><intSourceSysID>1008</intSourceSysID><intCurrentRowVersion>78046</intCurrentRowVersion><strSourceLocationCode>MYSH001</strSourceLocationCode><strSourceMachineCode>01</strSourceMachineCode><SysID>1008</SysID><MovementShopCode>MYSH001</MovementShopCode><MovementNo>AO00000004</MovementNo><MovementDate>2015-01-08T00:00:00</MovementDate><DocTypeCode>AO</DocTypeCode><MovementDirection>-1</MovementDirection><MovementStatus>NEW</MovementStatus><MovementVersion>1</MovementVersion><HandleVersion>0</HandleVersion><FromShop>MYSH001</FromShop><LocationCode>MYSH001</LocationCode><MachineCode>01</MachineCode><MarkDel>0</MarkDel><CurrentRowVersion>AAAAAAABMN4=</CurrentRowVersion><IsSource>1</IsSource><AllowPublishUp>1</AllowPublishUp><AllowPublishDown>1</AllowPublishDown><SourceTier>99</SourceTier><SourceLocationCode>MYSH001</SourceLocationCode><SourceMachineCode>01</SourceMachineCode><CreateDate>2015-01-08T15:59:00</CreateDate><CreateBy>admin</CreateBy><UpDateDate>2015-01-08T15:59:00</UpDateDate><UpDateBy>admin</UpDateBy></tblStockMovementHeader><tblStockMovementHeader><intRowNum>3</intRowNum><intSourceCurrentRowVersion>105095</intSourceCurrentRowVersion><intSourceSysID>2007</intSourceSysID><intCurrentRowVersion>105095</intCurrentRowVersion><strSourceLocationCode>MYSH001</strSourceLocationCode><strSourceMachineCode>01</strSourceMachineCode><SysID>2007</SysID><MovementShopCode>MYSH001</MovementShopCode><MovementNo>TO00000001</MovementNo><MovementDate>2015-03-03T00:00:00</MovementDate><DocTypeCode>TO</DocTypeCode><MovementDirection>-1</MovementDirection><MovementStatus>NEW</MovementStatus><MovementVersion>1</MovementVersion><HandleVersion>0</HandleVersion><FromShop>MYSH001</FromShop><ToShop>MYSH002</ToShop><Locati
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值