Skip to content

Instantly share code, notes, and snippets.

@Hugoberry

Hugoberry/XML.sql

Last active Apr 11, 2017
Embed
What would you like to do?
CREATE PROC [dbo].[usp_InsertDemoXML] @xmlBin AS varbinary(max)
AS
BEGIN
declare @xml xml = convert(xml,@xmlBin)
INSERT INTO Demo ([Key],[Value])
SELECT
[key] = x.v.value('key[1]','int'),
[Value] = x.v.value('value[1]','varchar(50)')
FROM @xml.nodes('/table/row') x(v)
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.