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
- Why does Azure Auto-Scale scale go lower then minimum amount of instances?
- Data execution plan ended with error on DB restore
- Why does Azure CloudConfigurationManager.GetSetting return null
- Do I need other roles than Worker Role for a web site and service layer in Azure?
- Azure Web App PATH Variable Modification
- Azure Data Factory: LinkedService for AzureSql in failed state
- How To Update a Web Application In Azure and Keep The App Up the whole time
- Using Azure MobileServices library with my own LAN WebApi
- ionCube loader error on Azure IIS
- App crash (if closed) after click on notification
- How to get sql data bases instances in azure using java api
- I want to create file in azure share using python PUT requests but getting error signature not correct including headers
- Enabling OPTIONS method on Azure Cloud Service (to enable CORS)
- Redirecting subdomain to directory on Azure
- Kaltura account settings error
Related Questions in AZURE-SQL-DATABASE
- Data execution plan ended with error on DB restore
- Azure Data Factory: LinkedService for AzureSql in failed state
- Data streams in case of Merge
- How to get sql data bases instances in azure using java api
- How can I deploy an app using Identity Model to Production on Azure?
- Fatal error: Call to undefined function sqlsrv_connect() in C:\xampp\htdocs
- How do you get the Id field for a newly inserted item using the .NET client for Azure Mobile
- SqlCommandBuilder() creates insert/update for underlying tables instead for a view
- Bulk insert using code first migrations for azure
- Cannot enable Full-Text search on Azure SQL Database V12
- Azure data sync not syncing sql database data properly as expected
- Using MVC App to run CRUD operations on Existing Azure Database
- Sql Server Data Tools Data Comparison fails when connecting to Azure
- ShardMapManager.TryGetRangeShardMap wont retrieve the RangeShardMap
- Always Get 1 record from Table 2 based on some condition
Related Questions in AZURE-SYNAPSE
- How to ensure faster response time using transact-SQL in Azure SQL DW when I combine data from SQL and non-relational data in Azure blob storage?
- Using Polybase technology in Azure SQL Data Warehouse, can I query data stored in parquet Hadoop formats?
- Why does Group by Grouping Sets work on SQL Server and not on the Azure SQL Data Warehouse?
- Multi-column IN / NOT IN subquery on Azure SQL data warehouse
- SQL DW - Partitioning using split
- Long running prepare statements on Azure SQL Data Warehouse
- Identifying needed statistics - Azure SQL Data Warehouse
- Depth of sys.dm_pdw_exec_requests on Azure SQL Data Warehouse
- Truncating table but leave statistics in place on Azure SQL Data Warehouse
- How to create more granular resource classes in Azure DW?
- Azure Data Factory Pipeline Calling a Stored Proc on Another Server
- Extract SQL Azure Federated Database to Data Warehouse with SSIS
- Pricing of SQL datawarehouse in azure
- Views on SQL DW are not visible in SSMS and in [INFORMATION_SCHEMA].[VIEWS]
- DMV [dm_pdw_exec_requests] having NULL start_time stamp, resource class
Related Questions in SQL-AZURE-FEDERATIONS
- SQL Azure 180 concurrent connections
- Unable to connect remotely to SQL Azure DB using SSMS 2016
- Multi-tenant federattion on primary key
- How to create Pear MDB2 sqlsrv connection for windows sql azure?
- How to immigrate from current federation system for Web Microsoft Azure databases to the new Elastic scale out in the Basic databases
- Ninject - Entity Framework - Change Context during Runtime
- Azure SQL alerts on a T sql query
- Azure Active Directory Federation
- Azure - How to get a list of federated databases?
- Acheiving horizontal scaling through federation?
- The constraint 'IDENTITY' is not supported in a federated database
- Is offline authentication possible with Azure Active Directory
- Azure: "WinHttpGetProxyForUrl failed" / System.Data.SqlClient.SqlException
- Azure Federations are Deprecated. What are my options?
- ALTER FEDERATION SWITCH operation failed. Specified boundary value does not exist
Related Questions in SQL-AZURE-ALERTS
- SQL Azure automated backup fails on a DB which has been deleted - cannot remove backup task
- Create an custom SQL Azure Alert that can be initiated by anyone
- How to resolve Azure Sql principal name formatted as guid@guid to a readable user name?
- SQL Server job error on email notification
- Required. SQL Azure Backup Alerts
- How can I be notified if someone creates a new database in Azure?
- Deleting a resource in Azure - Does it delete Alerts associated with it
- Configure Alert Mail (SendGrid) in Azure using Webhook
- How to Setup Alert on Azure SQL MI instance for % storage space used?
- Azure SQL alerts on a T sql query
- How to get alert for multiple pipelines success instead of 1 activity inside a pipeline in Azure Data Factory
- How to configure the alert whenever the primary Azure SQL Database goes down?
- Azure resource Health Alert - not triggered
- Azure Alert Notifications not activated
- Azure ARM template schema/documentation for setting up alerts on Database Pools
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 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.