<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic SQL Statement &amp;quot;OUTPUT&amp;quot; is not supported. in Data Warehouse</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/SQL-Statement-quot-OUTPUT-quot-is-not-supported/m-p/3266585#M20</link>
    <description>&lt;P&gt;Hi&lt;BR /&gt;In our DWH (an ASQL DB), we use a SP at the start of the ADF Pipeline to write some metadata about the Pipeline into an Audit log (table in DB).&amp;nbsp;&amp;nbsp;The following code is an excerpt of the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;insert into logging.adf_run_log (master_pl_run_id, parent_pl_run_id, pl_run_id, execution_object, source_object, layer, status, start_time)
		OUTPUT inserted.pl_run_id
		select ISNULL(@master_pl_run_id,cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier))
		     , ISNULL(@parent_pl_run_id,cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier))
		     , ISNULL(@pl_run_id,NEWID())
			 ,  @execution_object, @source_object, @layer, 'RUNNING', getdate()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the code works smoothly in the ASQL DB, we get an error message in Fabric.&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;"OUTPUT is not supported.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Msg 15868, level 16, state 11, code line 35&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Each SQL statement is executed as an independent session. The session context is not maintained across SQL statements."&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;The provided link for the infos about the error does not work: &lt;A href="https://go.microsoft.com/fwlink/?linkid=2230216" target="_blank" rel="noopener"&gt;https://go.microsoft.com/fwlink/?linkid=2230216&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Is this a bug?&lt;/P&gt;&lt;P&gt;If not, how can we write logging / audit infos about the Pipeline into a Fabric DWH?&lt;BR /&gt;We need to know, when a Pipeline runs starts, ends and the number of rows written, read etc.&amp;nbsp;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Sat, 03 Jun 2023 06:58:26 GMT</pubDate>
    <dc:creator>Pfisterbi</dc:creator>
    <dc:date>2023-06-03T06:58:26Z</dc:date>
    <item>
      <title>SQL Statement "OUTPUT" is not supported.</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/SQL-Statement-quot-OUTPUT-quot-is-not-supported/m-p/3266585#M20</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;In our DWH (an ASQL DB), we use a SP at the start of the ADF Pipeline to write some metadata about the Pipeline into an Audit log (table in DB).&amp;nbsp;&amp;nbsp;The following code is an excerpt of the code:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;insert into logging.adf_run_log (master_pl_run_id, parent_pl_run_id, pl_run_id, execution_object, source_object, layer, status, start_time)
		OUTPUT inserted.pl_run_id
		select ISNULL(@master_pl_run_id,cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier))
		     , ISNULL(@parent_pl_run_id,cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier))
		     , ISNULL(@pl_run_id,NEWID())
			 ,  @execution_object, @source_object, @layer, 'RUNNING', getdate()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;While the code works smoothly in the ASQL DB, we get an error message in Fabric.&amp;nbsp;&lt;BR /&gt;&lt;EM&gt;"OUTPUT is not supported.&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Msg 15868, level 16, state 11, code line 35&lt;/EM&gt;&lt;BR /&gt;&lt;EM&gt;Each SQL statement is executed as an independent session. The session context is not maintained across SQL statements."&lt;BR /&gt;&lt;/EM&gt;&lt;BR /&gt;The provided link for the infos about the error does not work: &lt;A href="https://go.microsoft.com/fwlink/?linkid=2230216" target="_blank" rel="noopener"&gt;https://go.microsoft.com/fwlink/?linkid=2230216&lt;/A&gt;.&lt;BR /&gt;&lt;BR /&gt;Is this a bug?&lt;/P&gt;&lt;P&gt;If not, how can we write logging / audit infos about the Pipeline into a Fabric DWH?&lt;BR /&gt;We need to know, when a Pipeline runs starts, ends and the number of rows written, read etc.&amp;nbsp;&lt;BR /&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jun 2023 06:58:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/SQL-Statement-quot-OUTPUT-quot-is-not-supported/m-p/3266585#M20</guid>
      <dc:creator>Pfisterbi</dc:creator>
      <dc:date>2023-06-03T06:58:26Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Statement "OUTPUT" is not supported.</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Warehouse/SQL-Statement-quot-OUTPUT-quot-is-not-supported/m-p/3273946#M21</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="379024" data-lia-user-login="Pfisterbi" class="lia-mention lia-mention-user"&gt;Pfisterbi&lt;/a&gt;&lt;BR /&gt;I am assuming that the code which you shared is from the SP . I will suggest you to please comment the below line and try again .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;insert into logging.adf_run_log (master_pl_run_id, parent_pl_run_id, pl_run_id, execution_object, source_object, layer, status, start_time)
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;-- OUTPUT inserted.pl_run_id
&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;		select ISNULL(@master_pl_run_id,cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier))
		     , ISNULL(@parent_pl_run_id,cast('00000000-0000-0000-0000-000000000000' as uniqueidentifier))
		     , ISNULL(@pl_run_id,NEWID())
			 ,  @execution_object, @source_object, @layer, 'RUNNING', getdate()&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Please do let us know how it goes .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;BR /&gt;Himanshu&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2023 05:28:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Warehouse/SQL-Statement-quot-OUTPUT-quot-is-not-supported/m-p/3273946#M21</guid>
      <dc:creator>HimanshuS-msft</dc:creator>
      <dc:date>2023-06-08T05:28:21Z</dc:date>
    </item>
  </channel>
</rss>

