Skip to content

Instantly share code, notes, and snippets.

@Hugoberry
Last active April 11, 2017 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Hugoberry/8ddacfa41ce888f458863185ecfc400f to your computer and use it in GitHub Desktop.
Save Hugoberry/8ddacfa41ce888f458863185ecfc400f to your computer and use it in GitHub Desktop.
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