Сценарий DDL для ручного развертывания сборки
— Create the assembly first.
CREATE ASSEMBLY [SQLMagDemo]  FROM «?C:Documents and SettingsAdministratorMy 
DocumentsVisual Studio ProjectsYukonSQLMaginSQLMagDemo.dll» WITH PERMISSION_SET = 
UNSAFE
GO

— Register all the functions the assembly exposes.

— Register the aggregate function.
CREATE AGGREGATE [clr_Concat](@value nvarchar(MAX)) RETURNS nvarchar(MAX)
EXTERNAL NAME [SQLMagDemo].[SQLMagDemo.clr_Concat]
GO

—
— Register the aggregate function.
CREATE AGGREGATE [clr_product](@value nvarchar(MAX)) RETURNS [int]
EXTERNAL NAME [SQLMagDemo].[SQLMagDemo.clr_product]
GO

— Register the trigger
— Note that the trigger can be created only when the underlying tables
— are also created.
CREATE TRIGGER [ValidateEmail] ON vin_EmailTest FOR INSERT, UPDATE
AS EXTERNAL NAME [SQLMagDemo].[SQLMagDemo.Triggers].[ValidateEmail]
GO

— Register the stored procedure.
CREATE PROCEDURE [clr_FixedDrives] 
AS EXTERNAL NAME [SQLMagDemo].[SQLMagDemo.StoredProcedures].[clr_FixedDrives]
GO

Поделитесь материалом с коллегами и друзьями