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 |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-05-09 : 08:27:26
|
| Anjin Pradhan writes "I have used this stored proceedure to insert multiple data in a database. Now i want to get the identitys of all the records that i have inserted how is this possibleCREATE procedure usp_InsertManyRows@XMLDOC textASdeclare @xml_hndl intBEGIN TRANSACTION TransactionNameexec sp_xml_preparedocument @xml_hndl OUTPUT, @XMLDOCInsert Into testtable ( InsertedID )Select IDToInsert From OPENXML(@xml_hndl, '/items/item', 1) With ( IDToInsert int '@id' )select * from testtable where id=@@identity COMMIT TRANSACTION TransactionNameGO " |
|
|
|
|
|