
Explanation/Reference:
Explanation:
Box 1: Modify the TRUSTWORTHY property of the database.
Box 2: Execute the CREATE ASSEMBLY statement.
Box 3: Execute the CREATE AGGREGATE statement.
Note:
* TRUSTWORTHY CREATE signature
The TRUSTWORTHY property indicates whether the instance of SQL Server trusts the database and the contents within it.
* CREATE AGGREGATE
Creates a user-defined aggregate function whose implementation is defined in a class of an assembly in the .NET Framework. For the Database Engine to bind the aggregate function to its implementation, the
.NET Framework assembly that contains the implementation must first be uploaded into an instance of SQL Server by using a CREATE ASSEMBLY statement.
* Example:
ALTER DATABASE [DatabaseName] SET TRUSTWORTHY ON
GO
CREATE ASSEMBLY [CLR.Utilities] FROM 'C:\Path\To\File\CLR.Utilities.dll' WITH PERMISSION_SET = UNSAFE
GO
CREATE AGGREGATE [dbo].[Concatenate] (@input nvarchar(max)) RETURNS nvarchar(max) EXTERNAL NAME [CLR.Utilities].[CLR.Utilities.Concatenate]
GO