将消息从 SQL 添加到 Azure 服务总线队列 [英] Add message to Azure Service Bus Queue from SQL

查看:51
本文介绍了将消息从 SQL 添加到 Azure 服务总线队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个数据库表上有一个 SQL 触发器,并且想在执行 SQL 触发器时向我的 Azure 服务总线队列添加一条消息.

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 代码示例吗?

Does anyone has a SQL code example of how to do this?

值得一提的是,SQL 将在 Azure 中运行的 SQL 数据库中运行.

It's worth mention that SQL will be running in a SQL database which is running in Azure.

请不要开始讨论是否使用 SQL 触发器的问题,这纯粹是为上述问题获取可用的 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 是在 VM 还是 SQL 数据库上运行.您可以做的是创建一个 CLR 存储过程并通过 REST API 调用 Azure 服务总线.

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.

https://blogs.msdn.microsoft.com/sqllive/2008/06/18/accessing-rest-based-web-services-using-sql-clr/

通过 REST API 的 Azure 服务总线队列

Azure Service Bus Queue through REST API

https://docs.microsoft.com/en-us/rest/api/servicebus/queues

这篇关于将消息从 SQL 添加到 Azure 服务总线队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆