Tuesday, 3 January 2012

How to select XML Data as table format in sql server

DECLARE @ONERROR INT
DECLARE @idoc INT
declare @xmlData NTEXT
set @xmlData ='some XML string '
EXEC sp_xml_preparedocument @idoc OUTPUT, @xmlData
set @str = '//Sheet' + cast(@TopSheetID as varchar(50)) + '/WBProducts'
Select * From OpenXML (@idoc,@str,3)
WITH tblProcess

No comments:

Post a Comment