XML : How to insert or update data into table from xml string using merge statement

suppose i have a xml stored into variable and now how could use merge statement to insert or update data into table from xml.

if anyone know the way please share code which i can run in sql server.

suppose my xml may look like

  <?xml version = "1.0" encoding="UTF-8" standalone="yes"?>  <document>    <employee>    <id>1</id>    <name>test1</name>    <salary>2000</salary>    </employee>    <employee>    <id>2</id>    <name>test2</name>    <salary>4000</salary>    </employee>    <employee>    <id>3</id>    <name>test3</name>    <salary>8000</salary>    </employee>  </document>    

thanks

No comments:

Post a Comment