So, the need to pass the array to Store Procedure is very comman and the best approch to do this is pass the xml to the Store Procedure in ntext variable.
Create procedure [dbo].[spSendXML]
(
@RecordXML ntext
)
AS
Begin
create Table #tbl (ID int)
DECLARE @idoc int
EXEC sp_xml_preparedocument @idoc OUTPUT, @RecordXML
insert into #tbl
select ID
FROM OPENXML(@idoc,'/Root/Comp', 1)
WITH (ID varchar(50))
End
By doing this you can get all the data in SQL Temp Table.
Calling of the same Store Procedure.
spSendXML '
Thanks
Dalip Vohra
No comments:
Post a Comment