SQL Server-使用CLR集成来使用Web服务 [英] SQL Server - Using CLR integration to consume a Web Service

查看:104
本文介绍了SQL Server-使用CLR集成来使用Web服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一些教程描述了如何使用SQL Server 2005的CLR集成来使用Web服务。在大多数情况下,该过程看起来很复杂。我遇到了一些问题,包括需要更改数据库的信任级别,以及使用sgen工具创建静态XmlSerializer程序集;而且我仍然没有使其正常工作...(我敢肯定,我只需要花更多的时间和精力)

There are a few tutorials on the web that describe consuming a Web Service using SQL Server 2005's CLR integration. For the most, the process seems pretty convoluted. I've run into several issues including the need to change my database's trust level, and using the sgen tool to create a static XmlSerializer assembly; and I still haven't gotten it working right... (I'm sure I just need to put a little more time and energy into it)

转到这种类型的体系结构时,对安全性,性能和维护有何影响?这可能是一个使用非常频繁的过程,并且易于维护相对重要。

What are the security, performance, and maintenance implications when going to this type of architecture? This would likely be a fairly heavily-used process, and ease of maintenance is relatively important.

我确实可以选择是否将其作为UDF集成到SQL Server中。 ,或者使其成为控制台/ Web应用程序的独立.NET库。

I do have freedom to choose whether to integrate this into SQL Server as a UDF, or have it be a stand alone .NET library for console/Web applications. Is the SQL CLR integration with external assemblies worth the trouble?

推荐答案

简短的答案是,不,SQL CLR集成可能不行吗?

The short answer is, no, SQL CLR Integration is probably not worth the trouble.

更长的答案有几点,从对数据库中的CLR编程开始。如果使用正确,它是一个很好的工具,但是如果使用不正确,它会增加内存消耗,并可能导致性能问题。我在数据库中使用它来实现非常专业的功能,例如添加RegEx功能,但是它很少使用,它具有经过测试的代码,可以防止出现尽可能多的问题。

The longer answer has several points, beginning with programming CLR in the database. It's a fine tool, when used correctly, but it does increase memory consumption and can lead to performance issues if not done correctly. I use it in my database for very specialized functionality, such as adding RegEx ability, but it's used sparingly, with well-tested code to prevent as many issues as possible from cropping up.

第二点是,正如您所指出的,您必须修改安全性,打开潜在的风险。

A second is, as you pointed out, you've got to modify security, opening up potential risks.

使用独立的应用程序将数据加载到您的服务器。您将拥有更多的控制权,更少的风险,并且轻松得多。

Use a stand alone application to load the data into your server. You'll have more control, less risk and a much easier time of it.

这篇关于SQL Server-使用CLR集成来使用Web服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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