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 |
|
mrkapoor
Starting Member
1 Post |
Posted - 2010-06-04 : 15:13:24
|
| I am trying to work with OPENXML and extract data, but am getting 2 NUll values from the example below. Please helpDECLARE @list xml,@xmlOutput intDECLARE @table table(CODE int NULL)SET @list = '<xmlversion="1.0"><CODES><CODE>1</CODE><CODE>2</CODE></CODES>'EXEC sp_xml_preparedocument @xmlOutput OUTPUT, @listINSERT INTO @tableSELECT *FROM OPENXML(@xmlOutput, '//CODES/CODE', 2) WITH (CODE int)SELECT * FROM @tableEXEC sp_xml_removedocument @xmlOutputRK |
|
|
Sachin.Nand
2937 Posts |
Posted - 2010-06-04 : 15:44:16
|
| Try ThisSelect x.i.value('.','varchar(10)') from @list.nodes('/CODES/CODE')x(i)Limitations live only in our minds. But if we use our imaginations, our possibilities become limitless. PBUH |
 |
|
|
|
|
|