Can somebody explain me why this T-SQL code only returns one row with the value "1"? I was expecting to get two rows ("1" and "2"). Am I missing something here?
DECLARE @XMLDoc2 XML
SELECT @XMLDoc2 = <ids><id>1</id><id>2</id></ids>
DECLARE @handle2 INT
EXEC sp_xml_preparedocument @handle2 OUTPUT, @XMLDoc2
SELECT * FROM OPENXML (@handle2, /ids , 2) WITH (id INT id )
EXEC sp_xml_removedocument @handle2
NOTE: I m using SQL Server 2008
Thanks a lot!