Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

More information on managed code UDF's in SQL Server 2005

4 views
Skip to first unread message

CDMAP...@fortunejames.com

unread,
Aug 25, 2006, 5:28:22 PM8/25/06
to
In:

http://groups.google.com/group/comp.databases.ms-access/msg/ec3b99fed4b094ed

I said:

>Here's the reply:
>
>'-------
>You can find information on CREATE ASSEMBLY here.
>
>
>http://msdn2.microsoft.com/en-us/library/ms189524.aspx
>
>
>Mike
>'-------

Here's some more information on managed code UDF's in SQL Server 2005:

>From CLR Integration example, DAT418 (Christian Kleinerman):

Public Function
GetTax(ByVal amount As Integer) As Integer
Return (amount * 0.68)
End Function

Compile code into an assembly.

SQL Server 2005:

CREATE ASSEMBLY FinancialLib
FROM 'c:\FinLib\bin\bl.dll'
WITH PERMISSION_SET = EXTERNAL_ACCESS

After that step, the assembly is copied into SQL Server.

CREATE FUNCTION financial.GetTax(@it int)
RETURNS decimal(38,10)
AS EXTERNAL

SELECT financial.GetTax(id)
FROM hr.employees;

James A. Fortune
CDMAP...@FortuneJames.com

0 new messages