Say I have the following situation (for demonstration). The simple table content is converted to an XML value and sent via Service Broker to another SQL server where the res
And other option (i would prefer Remus Rusanu example though.. If a lots of columns and table structures are the same, this helps get lazy):
declare @x xml = (SELECT * FROM tab FOR XML RAW, root('tab'), TYPE);
Declare @docHandle int
EXEC sp_xml_preparedocument @docHandle OUTPUT, @x
Select *
FROM OPENXML(@docHandle, 'tab//', 1)
With dbo.Tab
EXEC sp_xml_removedocument @docHandle