来自 SQL Server 项目的进程间通信 [英] Interprocess communication from SQL Server Project

查看:22
本文介绍了来自 SQL Server 项目的进程间通信的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试创建一个连接到第 3 方服务(与 SQL Server 实例托管在同一台服务器上)的 SQL Server CLR 用户定义函数.有没有办法让 WCF 命名管道或 TCP 在这种情况下工作?如果我提供中介服务,是否有更好的方法来做到这一点?

I'm trying to create a SQL Server CLR user-defined function that connects to a 3rd-party service (hosted on the same server as the SQL Server instance). Is there a way to get WCF named pipes or TCP to work in this situation? Is there a better way to do this, if I provide an intermediary service?

推荐答案

不要在 SQLCLR 中实现 IPC.SQL 服务器托管的 CLR 使用 SQL 线程原语,你最终会饿死 SQL 工作线程和调度程序.

Don't implement IPC in SQLCLR. The SQL server hosted CLR uses SQL threading primitives and you'll end up starving the SQL worker threads and schedulers.

从 SQL Server 之外的进程执行所有 IPC.如果您需要通过 SQL 作业(来自存储过程和触发器)与此进程通信,请使用数据库内排队,通过 表作为队列 或通过 服务代理.

Do all your IPC from a process outside SQL Server. If you need to communicate with this process from SQL jobs (from stored procedures and triggers) use in-database queuing, either by Tables as Queues or by Service Broker.

这篇关于来自 SQL Server 项目的进程间通信的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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