Azure - How to execute UDF from external data source in select statement

102 Views Asked by At

I have an external data source created in DB1 and its pointing to DB2 database in Azure.

I want to query a UDF defined in DB2 from DB1.

Following syntax works, from DB1:

EXEC sp_execute_remote
N'Ext_DB2',
N'SELECT Result'

But I want to use following syntax:

select C1, C2, < function_in_DB2 > from t1

I tried searching web, this format is not mentioned anywhere, is it not supported? Any pointers will help.

Thanks !

1

There are 1 best solutions below

0
On

Just per my experience, I think Azure SQL database doesn't support it. As we know, we can't do cross database query directly.

Since none document talk about this, I would suggest you ask Azure SQL support to get more support, ref: How to create an Azure support request.

Hope this helps.