zoukankan      html  css  js  c++  java
  • sql2008 xml 读取 写入 存储过程

    alter procedure p_load_stryker_xml @xml nvarchar(max) as set nocount on declare @ixml int EXEC sp_xml_preparedocument @ixml OUTPUT, @xml INSERT INTO t_dealer_out_import (id,indexid,productid,productcode,sn,barcodep,barcodes,quantity,productname,ProductGroup,ProductLine,ProductCategory,reason,dealer,dealerid,changedealerid,stockdate,deptid,dept,ProvinceId,province,hospitalid,Hospital,ordercode,price,reportdate,dealerShortName,OrderNo) SELECT * FROM OPENXML (@ixml, '/root/row',2) WITH ( id int 'id', indexid nvarchar(50) 'indexid', productid nvarchar(50) 'productid', productcode nvarchar(50) 'productcode', sn nvarchar(50) 'sn', barcodep nvarchar(50) 'barcodep', barcodes nvarchar(50) 'barcodes', quantity int 'quantity', productname nvarchar(255) 'productname', ProductGroup nvarchar(100) 'ProductGroup', ProductLine nvarchar(100) 'ProductLine', ProductCategory nvarchar(100) 'ProductCategory', reason text 'reason', dealer nvarchar(100) 'dealer', dealerid nvarchar(50) 'dealerid', changedealerid nvarchar(50) 'changedealerid', stockdate nvarchar(50) 'changedealerid', deptid nvarchar(50) 'deptid', dept nvarchar(100) 'dept', ProvinceId nvarchar(10) 'ProvinceId', province nvarchar(50) 'province', hospitalid nvarchar(50) 'hospitalid', Hospital nvarchar(50) 'Hospital', ordercode nvarchar(50) 'ordercode', price decimal(18, 2) 'price', reportdate nvarchar(50) 'reportdate', dealerShortName nvarchar(50) 'dealerShortName', OrderNo nvarchar(50) 'OrderNo' ) SELECT id,indexid,productid,productcode,dealer,dept,province,Hospital,reportdate,dealerShortName,OrderNo From t_dealer_out_import where id in ( SELECT id FROM OPENXML (@ixml, '/root/row',2) WITH ( id int 'id' ) ) EXEC sp_xml_removedocument @ixml

  • 相关阅读:
    Springboot之配置定时任务
    Java之随机生成各种类型的数据举例
    docker安装postgresql 12.4
    Java随机生成字符串举例
    Java生成UUID
    Shell case 多选择语句用法举例
    Elasticsearch学习之集群高级网络设置
    交叉熵损失函数
    将博客搬至CSDN
    SonarQube服务搭建
  • 原文地址:https://www.cnblogs.com/y0umer/p/3839342.html
Copyright © 2011-2022 走看看