USE [DATA]
GO
/****** Object: StoredProcedure [dbo].[usp_ss] Script Date: 2021/1/3 15:31:22 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author: <Author,,Name>
-- Create date: <Create Date,,>
-- Description: <Description,,>
-- =============================================
ALTER PROC [dbo].[usp_ss] @xmlBin as varbinary(max)
AS
BEGIN
declare @xml1 xml = convert(xml,@xmlBin)
INSERT INTO Data_ss ([test1],[test2],[test3],[test4],[test5],[test6],[test7],[test8],[test9])
SELECT
[test1] = x.v.value('date[1]','date'),
[test2] = x.v.value('account[1]','nchar(100)'),
[test3] = x.v.value('timep[1]','nchar(100)'),
[test4] = x.v.value('time[1]','nchar(100)'),
[test5] = x.v.value('canal[1]','nchar(100)'),
[test6] = x.v.value('impression[1]','int'),
[test7] = x.v.value('click[1]','int'),
[test8] = x.v.value('cost[1]','float'),
[test9] = x.v.value('item[1]','nchar(100)')
FROM @xml1.nodes('/table/row') x(v)
END
求大佬帮忙...
多字段重复啥意思
用merge into 这种写法做个判断就ok了https://www.cnblogs.com/kongxc/p/9237941.html