title: Parsing XML into a SQL table WITHOUT predefining structure. Possible?
body: <p>So using the code below... can I parse <code>@xml_data</code> into a table structure <em>without</em> predefining the structure?</p>
  
  <pre><code>DECLARE @receiveTable TABLE(xml_data XML) DECLARE @xml_data XML
  DECLARE @strSQL NVARCHAR(2000)
  SET @strSQL = 'SELECT * INTO #tmp1 FROM sysobjects;
  DECLARE @tbl TABLE(xml_data xml);
  DECLARE @xml xml;    
  Set @xml = (Select * from #tmp1 FOR XML AUTO);
  INSERT INTO @tbl(xml_data) SELECT @xml;
  SELECT * FROM @tbl'
  
  INSERT INTO @receiveTable EXEC (@strSQL)    
  SET @xml_data = (SELECT * FROM @receiveTable)    
  SELECT @xml_data
  </code></pre>