We have a table where we create a record for a job and remove them once the job is complete. I would like to check if there is any records still hanging more than a an hour or so. We do maintain audit timestamps in the table. Is there in an option in anyway I can create an alert on Azure SQL based on a TSQL query or something which we help achieve the above?
Azure SQL alerts on a T sql query
2.8k Views Asked by s-a-n At
2
There are 2 best solutions below
3
Leon Yue
On
Azure SQL alerts only support these metrics:
So we can't create an alert on Azure SQL based on a TSQL query.
I guess that you want to check if there is any records still hanging more than a an hour or so in the table. If the table has, you want it can sends you an email as alerts.
If you table is stored in SQL Server, you can create a trigger and use sp_send_dbmail to achieve this.
For more details, you can see: sp_send_dbmail
And here's a blob about: Send e-mail from a trigger
Azure SQL Database doesn't support sp_send_dbmail:

Hope this can helps you.
Related Questions in AZURE
- How to update to the latest external Git in Azure Web App?
- I need an azure product that executes my intensive ffmpeg command then dies, and i only get charged for the delta. Any Tips?
- Inject AsyncCollector into a service
- mutual tls authentication between app service and function app
- Azure Application Insights Not Displaying Custom Logs for Azure Functions with .NET 8
- Application settings for production deployment slot in Azure App Services
- Encountered an error (ServiceUnavailable) from host runtime on Azure Function App
- Implementing Incremental consent when using both application and delegated permissions
- Invalid format for email address in WordPress on Azure app service
- Producer Batching Service Bus Vs Kafka
- Integrating Angular External IP with ClusterIP of .NET microservices on AKS
- Difficulty creating a data pipeline with Fabric Datafactory using REST
- Azure Batch for Excel VBA
- How to authenticate only Local and Guest users in Azure AD B2C and add custom claims in token?
- Azure Scale Sets and Parallel Jobs
Related Questions in AZURE-SQL-DATABASE
- Driver com.microsoft.sqlserver.jdbc.SQLServerDriver claims to not accept jdbcUrl, ${SPRING_DATASOURCE_URL}: GitHub Actions
- Tools for fast aggregation
- Hoiw can i remove all ip addresses from Azure SQL Server Firewall Rules , but still login via SSMS?
- Small percentage of parameters cause very slow queries
- Azure Functions v4 in Private vNet Cannot Connect to Azure Sql
- Does bcp utility support Token based Authentication? If yes, I would like to know the process and which version of bcp to be used
- "Error: Could Not create constraint or index. see previous errors" with nest js and AzureSql
- Recreating an existing edmx in Visual Studio Code for Azure Function
- How to use parameter in Azure sql_input with LIKE SQL command
- How to Process a CSV File from Power Apps/Automate into SQL Server
- Unable to connect to Azure SQL from Azure Data Factory
- Table gets promoted with no data to Prod for Azure SQL database through Azure DevOps
- System Assigned identity failed to connect to SQL Server database
- Optimal approach in accessing datalake container with multiple teams?
- Azure SQL support for Delta tables
Related Questions in AZURE-SYNAPSE
- Microsoft Fabric components and data replication
- Parmeter values not resolving in ADF
- Azure Synapse Link for Dataverse - Tables from F&O - only available via Spark pool for Delta Lake?
- Reading Unstructured Text from the entire file in Azure Data Factory
- Fetch non-structured data in Synapse for Cosmos DB NoSQL?
- Unable to load data from on prem to Synapse using polybase/Copy Method
- Azure Function time running increase after each run
- Unable to Read Synapse LakeDB tables from PowerBI
- Synapse pipeline - extract year and country from a filename in a wildcard path
- REST call in Copy Activity under Azure Synapse / ADF
- SQL Tranformations in view or stored procedure?
- Azure Synapse data via API
- Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 1 - When reading table in SQL
- Cannot setup credentials to run Azure Batch custom from Synapse pipeline
- Recursive CTE showing all levels of ragged-hierarchy BOMs
Related Questions in SQL-AZURE-FEDERATIONS
- Acheiving horizontal scaling through federation?
- Azure Active Directory Federation
- Azure SQL alerts on a T sql query
- Unable to connect remotely to SQL Azure DB using SSMS 2016
- Is offline authentication possible with Azure Active Directory
- ALTER FEDERATION SWITCH operation failed. Specified boundary value does not exist
- SQL Azure Federation Database Backup
- How to immigrate from current federation system for Web Microsoft Azure databases to the new Elastic scale out in the Basic databases
- Azure: Federations have been deprecated, so how to implement 'custom sharding'?
- Azure Federations are Deprecated. What are my options?
- Azure - How to get a list of federated databases?
- SQL Azure 180 concurrent connections
- SQL Azure Federations and Indexes - Clarification on Performance
- Federation key issue
- How to create Pear MDB2 sqlsrv connection for windows sql azure?
Related Questions in SQL-AZURE-ALERTS
- Azure SQL MI storage space alert
- How to Setup Alert on Azure SQL MI instance for % storage space used?
- Azure resource Health Alert - not triggered
- SQL Server job error on email notification
- Required. SQL Azure Backup Alerts
- How to resolve Azure Sql principal name formatted as guid@guid to a readable user name?
- How can I be notified if someone creates a new database in Azure?
- How to configure the alert whenever the primary Azure SQL Database goes down?
- How to choose right threshold value for DCU percentage metric alert?
- In Azure, how can you configure an alert or notification when a SQL Server failover happened?
- How to get alert for multiple pipelines success instead of 1 activity inside a pipeline in Azure Data Factory
- Azure SQL alerts on a T sql query
- Create an custom SQL Azure Alert that can be initiated by anyone
- Deleting a resource in Azure - Does it delete Alerts associated with it
- Configure Alert Mail (SendGrid) in Azure using Webhook
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
You can use a Condition Control of an Azure Logic App to check whether a given result set is valid. If the condition satisfies then you can send the email.
You can execute a stored procedure action to check records hanging more than a an hour. On below images stored procedure returns resultsets, you can use the logic for checking records still hanging more than a an hour and in the next condition you can check the result set brings records (is true) or not (is false). If it's true you can send email else not.