Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
om09
Starting Member
2 Posts |
Posted - 2009-03-24 : 10:02:29
|
| Hi all,I want to insert multiple row from xml file to table in database.. i am try this code to insert..ALTER PROCEDURE sp_InsertByXML ( @strXML VARCHAR(4000) )ASBEGINDECLARE @intDocHandle int --Create an internal representation of the XML document.EXEC sp_xml_preparedocument @intDocHandle OUTPUT, @strXML INSERT INTO Person ( PersonId, PersonName )SELECT * FROM OPENXML(@intDocHandle, '/PersonData/Person', 2)WITH( PersonId INT, PersonName VARCHAR(100)) -- Remove the internal representation.EXEC sp_xml_removedocument @intDocHandle ENDplease any one help me to resolve this issue.Regards,Omom |
|
|
yosiasz
Master Smack Fu Yak Hacker
1635 Posts |
Posted - 2009-03-24 : 16:13:17
|
| so what seems to be the problem? do you haev an xml string? |
 |
|
|
om09
Starting Member
2 Posts |
Posted - 2009-03-25 : 02:42:35
|
| ya. i am using an xml file.then i want all the data from xml to insert at in single click of button to database table.Regards,Omom |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2009-03-25 : 14:24:33
|
| how will be xml structure? |
 |
|
|
|
|
|