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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
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.
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.