How to insert data in multilple tables from xml file in sql?
how to read xml file and insert data in multiple tables from xml file in sql server 2008?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Vithal WadjePosted Oct 3, 2014, 5:35 AM
CREATE PROCEDURE SaveUserDetails
@UserDetXML XML
AS
BEGIN
INSERT INTO UserDet
(Name,city)
SELECT
User.record.query('Name').value('.', 'varchar(50)'),
User.record.query('City').value('.', 'varchar(100)')
FROM @UserDetXML .nodes('ArrayOfUserDetail/UserDetail') AS UserData(record)
END