I have a SQL trigger on one of my database tables and would like to add a message to my Azure Service Bus Queue when the SQL trigger is executed.
我在其中一个数据库表上有一个SQL触发器,并希望在执行SQL触发器时向我的Azure Service Bus Queue添加一条消息。
Does anyone has a SQL code example of how to do this?
有没有人有一个如何执行此操作的SQL代码示例?
It's worth mention that SQL will be running in a SQL database which is running in Azure.
值得一提的是,SQL将在一个在Azure中运行的SQL数据库中运行。
Please do not start a discussion of the question of using SQL triggers or not this is purely get working SQL code for the question above.
请不要开始讨论使用SQL触发器的问题,或者这不是纯粹为上述问题获取工作的SQL代码。
1 个解决方案
#1
1
It's not clear if your SQL is running on a VM or SQL Database. What you could do is create a CLR Stored Procedure and call the Azure Service Bus through REST APi.
目前尚不清楚您的SQL是在VM还是SQL数据库上运行。您可以做的是创建CLR存储过程并通过REST APi调用Azure Service Bus。
https://blogs.msdn.microsoft.com/sqllive/2008/06/18/accessing-rest-based-web-services-using-sql-clr/
https://blogs.msdn.microsoft.com/sqllive/2008/06/18/accessing-rest-based-web-services-using-sql-clr/
Azure Service Bus Queue through REST API
Azure API通过REST服务总线队列
https://docs.microsoft.com/en-us/rest/api/servicebus/queues
https://docs.microsoft.com/en-us/rest/api/servicebus/queues
#1
1
It's not clear if your SQL is running on a VM or SQL Database. What you could do is create a CLR Stored Procedure and call the Azure Service Bus through REST APi.
目前尚不清楚您的SQL是在VM还是SQL数据库上运行。您可以做的是创建CLR存储过程并通过REST APi调用Azure Service Bus。
https://blogs.msdn.microsoft.com/sqllive/2008/06/18/accessing-rest-based-web-services-using-sql-clr/
https://blogs.msdn.microsoft.com/sqllive/2008/06/18/accessing-rest-based-web-services-using-sql-clr/
Azure Service Bus Queue through REST API
Azure API通过REST服务总线队列
https://docs.microsoft.com/en-us/rest/api/servicebus/queues
https://docs.microsoft.com/en-us/rest/api/servicebus/queues