DataBase/SQL Server
SQL Server 어셈블리 등록
탑~!
2021. 6. 14. 13:45
USE [master]
--CLR 활성작업
SET NOCOUNT ON;
USE master;
EXEC sp_configure 'clr enabled', 1;
RECONFIGURE;
GO
--TRUSTWORTHY 기본 속성이 OFF이므로 높은 권한적용을 위해 ON 시킴
ALTER DATABASE ActiveMDM
SET TRUSTWORTHY ON
USE [ActiveMDM]
GO
/*
DROP FUNCTION [mirae].[UF_CREATE_SEND_FILE]
DROP ASSEMBLY [ActiveMDMInterface]
*/
--ASSEMBLY 생성
CREATE ASSEMBLY [ActiveMDMInterface]
FROM 'D:\MDMInterface\ActiveMDMInterface.dll' --파일 지정 경로
WITH PERMISSION_SET = UNSAFE
GO
CREATE FUNCTION [mirae].[UF_CREATE_SEND_FILE](@strInputValue1 [nvarchar](100), @strInputValuePath [nvarchar](100))
RETURNS [nvarchar](max) WITH EXECUTE AS CALLER
AS
EXTERNAL NAME [ActiveMDMInterface].[CreateSendTargetFile].[CreateFile]
GO