--sp_configure 'show advanced options', 1;
--GO
--RECONFIGURE;
--GO
--sp_configure 'clr enabled', 1;
--GO
--RECONFIGURE;
--GO

USE [DB_NAME]
GO

--DROP ASSEMBLY [Neo.SqlServer.Security]

CREATE ASSEMBLY [Neo.SqlServer.Security]
AUTHORIZATION dbo  
FROM 'C:\Development\Orca\Neo\SqlServer\V1\Deploy\Neo.SqlServer.Security.dll' 
WITH PERMISSION_SET = SAFE
GO


GO
CREATE FUNCTION HashPassword
(
    @Password NVARCHAR(MAX)
)
RETURNS NVARCHAR(MAX)
AS EXTERNAL NAME [Neo.SqlServer.Security].[Neo.SqlServer.Authentication].HashPassword
GO


GO
CREATE FUNCTION CreatePasswordSalt()
RETURNS NVARCHAR(MAX)
AS EXTERNAL NAME [Neo.SqlServer.Security].[Neo.SqlServer.Authentication].CreatePasswordSalt
GO

GO
CREATE FUNCTION CreatePassword
(
    @Length INT
)
RETURNS NVARCHAR(MAX)
AS EXTERNAL NAME [Neo.SqlServer.Security].[Neo.SqlServer.Authentication].GeneratePassword
GO

