Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Pfisterbi
Advocate I
Advocate I

SQL Statement "OUTPUT" is not supported.

Hi
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).  The following code is an excerpt of the code: 

 

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()

 

While the code works smoothly in the ASQL DB, we get an error message in Fabric. 
"OUTPUT is not supported.
Msg 15868, level 16, state 11, code line 35
Each SQL statement is executed as an independent session. The session context is not maintained across SQL statements."

The provided link for the infos about the error does not work: https://go.microsoft.com/fwlink/?linkid=2230216.

Is this a bug?

If not, how can we write logging / audit infos about the Pipeline into a Fabric DWH?
We need to know, when a Pipeline runs starts, ends and the number of rows written, read etc. 
Thank you.

1 REPLY 1
HimanshuS-msft
Community Support
Community Support

Hello  @Pfisterbi
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 . 

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()


Please do let us know how it goes .

 

Thanks 
Himanshu 

 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.