There is a sql statement which uses a table valued clr function which inside opens another context connection ( using (var connection = new SqlConnection("context connection=true")) ) and using another separate select statement.
SELECT * FROM dbo.tablea a CROSS APPLY dbo.CLRDataAccessFunction() c
I started using xtended events and monitoring query_post_execution_showplan, rpc_completed, sp_statement_completed, sql_batch_completed, sql_statement_completed events. I can capture the events generated by the initial sql statement but I cannot capture events that was created within clr by the context connection.
Is there a way to capture the events created within the context connection?
Thank you
Gokhan Varol