mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
23 lines
580 B
Plaintext
23 lines
580 B
Plaintext
<#@output extension=".sql"#>
|
|
<#@ template language="C#" hostspecific="True" #>
|
|
|
|
DROP AGGREGATE IF EXISTS TC.CLUSTERING;
|
|
GO
|
|
|
|
DROP SCHEMA IF EXISTS TC;
|
|
GO
|
|
|
|
--Drop the assembly if it already exists
|
|
DROP ASSEMBLY IF EXISTS TransitiveClosure;
|
|
GO
|
|
|
|
--Create the assembly
|
|
CREATE ASSEMBLY TransitiveClosure FROM '<#= this.Host.ResolvePath("bin\\Release\\TransitiveClosureAggregatorLibrary.dll") #>' WITH PERMISSION_SET = SAFE;
|
|
GO
|
|
|
|
CREATE SCHEMA TC;
|
|
GO
|
|
|
|
CREATE AGGREGATE TC.CLUSTERING(@id1 INT, @id2 INT)
|
|
RETURNS NVARCHAR(MAX)
|
|
EXTERNAL NAME TransitiveClosure.[TransitiveClosure.Aggregate]; |