Manual Import

Listing 3. If you are manually importing the assembly into the database using SQL Server Management Studio, you also need to manually execute a CREATE FUNCTION statement to explicitly wire-up SQL Server to the function in the assembly.

CREATE FUNCTION [dbo].[MoonPhase](@inDate [datetime])
RETURNS [float] WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [SqlclrDemo].[UserDefinedFunctions].[MoonPhase]