Pass parameter value to sql query in databricks sql alert

gayatrikhatale
Databricks Partner

Hi,
I have created a sql query with the parameter.
Now using that parameterized sql query in databricks legacy sql alert.
And scheduling that databricks sql alert in databricks workflow/job using Sql task type.
Now how should I pass the parameter value to sql query. Because I want to send that parameter value in runtime.

Khaja_Zaffer
Esteemed Contributor

Hello @gayatrikhatale 

Good day!!

 

You can use like this 

Khaja_Zaffer_0-1756767985269.png

Just to understand, did you save the alert with the threshold value?

Khaja_Zaffer
Esteemed Contributor

I understand your issue but here: https://learn.microsoft.com/en-us/azure/databricks/jobs/sql#:~:text=Alerts%20do%20not%20support%20pa.... according to documentation it says not supported. 

if you want to do it dynamically enter a value, its complicated. 

gayatrikhatale
Databricks Partner

Thanks for the clarification.

Hello @gayatrikhatale 

If you are okay, can you please share what you are trying to parameterize in the sql query. If you share in detail I think we can work out. 
If you already got a solution let me know. 

Thank you. 

Hi @Khaja_Zaffer ,

My issue is resolved. I am using SQL Query API to parameterize sql query and assign a new value every time. And then using that SQL query in the alert.

Thank you!

View solution in original post

Okay thank you @gayatrikhatale 

Good to know that.