cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

How to pass a dynamic query to source server from databricks

Rajani
Contributor II

I have this usecase wherein i am supposed to pass a dynamic query to get data from source I have tried the query option but its giving error 
SparkConnectGrpcException: (com.microsoft.sqlserver.jdbc.SQLServerException) Incorrect syntax near the keyword 'exec'.
I have tried executing same query in sql server and it works fine.Does anyone know how can i acheive it?

i have also tried the prepare_query option and tried to pass two queries it was helpful when i was passing cte but not when a dynamic query is created.

can anyone help?

#jdbc#databricks#dynamicQuery

 

1 ACCEPTED SOLUTION

Accepted Solutions

Rajani
Contributor II

Hi  
thanks for your reply,
I have used foreign catalouge to fetch required data from information schema  then i am creating the dynamic query in databricks and then passing in query this is working for me! 



@Retired_mod

View solution in original post

1 REPLY 1

Rajani
Contributor II

Hi  
thanks for your reply,
I have used foreign catalouge to fetch required data from information schema  then i am creating the dynamic query in databricks and then passing in query this is working for me! 



@Retired_mod

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group