I trying to call my first CLR stored procedure in SQL server 2008. I have successfully compiled the DLL and created the assembly. Now I am trying to Create the stored procedure that references the registered assembly by using the CREATE PROCEDURE statement. Following this tutorial, I am getting the syntax error...
--This line worked. Just including this code just to show what I am doing ...
--create assembly
--LevenshteinLibrary
--from 'Drive Letter:\Path\LevenshteinLibrary.dll'
create procedure testCLR(@s1 nvarchar(1000), @s2 nvarchar(1000))
as external LevenshteinLibrary.getLevenshteinDistance --Incorrect syntax near '.'.
What should I do to create this procedure? I don't see anything on the msdn create procedure page explaining the proper syntax for "as external."
The VB.net code looks like this:
Imports System.Math
Imports System.Text.RegularExpressions
Imports Microsoft.SqlServer.Server
Partial Public Class LevenshteinerAndSoundexer
<SqlProcedure()> _
Public Shared Function getLevenshteinDistance(ByVal string1 As String, ByVal String2 As String) As Integer