如何在SQL Server 2008中部署CLR功能 [英] how to deploy the CLR functions in SQL server 2008

查看:141
本文介绍了如何在SQL Server 2008中部署CLR功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在VS2008中创建了一个SQL Server项目'RegularExpression'。在该项目中,我创建了一个'Regex.cs'类,并编写了一个有关正则表达式的函数。

I created a SQL Server Project in VS2008 called 'RegularExpression'.In that Project i created a 'Regex.cs' class and i wrote one function regarding Regular Expression.

然后我构建解决方案。

现在,我的问题是通过脚本在SQL Server 2008中部署此解决方案。(不仅仅是单击VS2008中的部署)。

Now My problem is to deploy this solution in SQL server 2008 through scripts.( not just clicking on Deploy in VS2008 ).

我成功地使用 CREATE ASSEMBLY< AName>在SQL 2008中部署了该项目的组件。从'< .dll的路径>'

,但是我没有得到我在VS2008中的SQL 2008 Function部分编写的函数。

but iam not getting that function i wrote in VS2008 in SQL 2008 Function section.

推荐答案

CREATE ASSEMBLY [RegularExpression]
AUTHORIZATION [dbo]
FROM < DLL Path > 
WITH PERMISSION_SET = SAFE
GO

/****** Object:  UserDefinedFunction [dbo].[Regex]    Script Date: 01/23/2010 15:08:01 ******/
CREATE FUNCTION [dbo].[Regex](@Pattern [nvarchar](2000), @Input [nvarchar](2000))
RETURNS [bit] WITH EXECUTE AS CALLER
AS 
EXTERNAL NAME [RegularExpression].[UserDefinedFunctions].[Regex]
GO

http://www.setfocus.com/technicalarticles/clrfunctionforsqlserver_2.aspx

以上链接很有帮助

这篇关于如何在SQL Server 2008中部署CLR功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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