AS EXTERNAL NAME
GetNotaflowInfoCLR.[GetNotaflowInfoCLR.UserDefinedFunctions].GetLastStepCompleted
GO
error:
Msg 6505 Could not find Type
'My.SQLServer.GetNotaflowInfoCLR.UserDefinedFunctions' in assembly 'UDF_CLR'.
I did try several syntaxes but no luck so far:
--AS EXTERNAL NAME
GetNotaflowInfoCLR.[GetNotaflowInfoCLR.UserDefinedFunctions].GetLastStepCompleted
--AS EXTERNAL NAME
GetNotaflowInfoCLR.[GetNotaflowInfoCLR].[UserDefinedFunctions.GetLastStepCompleted]
Something within 2008?
Thanks for your help,
Frans
I would interpret this as that your assembly refers a CLR type which
is not present in SQL Server, or at least not in the database you
are trying to create the assembly in.
I don't know where this My.SQLServer comes from, but I assume that your
assembly has a reference to it.
--
Erland Sommarskog, SQL Server MVP, esq...@sommarskog.se
Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
the error message (My.SQLserver) is from another try.
This is the create function statement now:
CREATE FUNCTION fnGetLastStepcompleted
(
@DossierID int
)
RETURNS INT
AS EXTERNAL NAME [UDF_CLR].[UserDefinedFunctions].GetLastStepCompleted
GO
Message: Could not find Type 'UserDefinedFunctions' in assembly 'UDF_CLR'.
The Visual Studio 2008 package:
Public Class UserDefinedFunctions
Public Shared Function GetLastStepCompleted(ByVal DossierID As Integer)
As SqlString
Dim svc As New NotaflowClientService.ClientService
Dim D As New NotaflowClientService.Dossier
D = svc.GetDossier(DossierID, True)
Return (D.LastStepCompleted.ToString)
End Function
End Class
I debug and the UDF_CLR Assemblie is created.
It looks like syntax to me, but maybe it's something else.
Help is appreciated.
If you use Visual Studio, you may have to use extra attributes do
get Visual Studio to do things right. I prefer to compile from the
command line and then use CREATE ASSEMBLY. (Well, it's more than
preference. Visual Studio just goes over my head.)
AS EXTERNAL NAME
[UDF_CLR].[<namespace>.UserDefinedFunctions].GetLastStepCompleted
Replace <namespace> with the .NET namespace of your function (it may be a
default namespace, look on the properties tab of the project). Also, as
Erland mentioned, parameters to the function and results returned from the
function should be Sql... nullable types that can handle SQL NULL.
--
Thanks
Michael Coles
SQL Server MVP
Author, "Expert SQL Server 2008 Encryption"
(http://www.apress.com/book/view/1430224649)
----------------
"Erland Sommarskog" <esq...@sommarskog.se> wrote in message
news:Xns9CD9C0A1C...@127.0.0.1...