سؤال

I am using:

SELECT * FROM #Bla FOR XML AUTO, ELEMENTS

which gives me this:

<_x0023_Bla>
  <Id>11</Id>
  <Name>XYZ</Name>
</_x0023_Bla>
<_x0023_Bla> 
  <Id>14</Id>
  <Name>X &amp; Y</Name>
</_x0023_Bla>

Is there a way to suppress x0023? The intention is to pass this as NVARCHAR(MAX) to a sproc and then reassemble the table #Bla there. Thanks.

هل كانت مفيدة؟

المحلول

Use table alias.

SELECT * FROM #Bla as Bla FOR XML AUTO, ELEMENTS
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top