Files
sql-server-samples/samples/features/ssms-templates/Sql/Function/CLR Function.sql
T
2018-05-06 12:19:40 -04:00

20 lines
611 B
Transact-SQL

--=============================================================
-- Create CLR Function template
--
-- This example creates an assembly named "utf8string" in the
-- local database. Then, it creates a CLR function named
-- "GetCurrentTimeMs" that references "GetCurrentTimeMs"
-- of classutf8.Utils in assembly utf8string.
--=============================================================
USE AdventureWorks
GO
CREATE ASSEMBLY utf8string
FROM '\\MachineName\utf8string\bin\Debug\utf8string.dll'
GO
CREATE FUNCTION GetCurrentTimeMs()
RETURNS bigint
AS EXTERNAL NAME utf8string.utf8string.GetCurrentTimeMs
GO