mirror of
https://github.com/Microsoft/sql-server-samples.git
synced 2025-12-08 14:58:54 +00:00
Updating template to drop trusted assembly only if it exists, preventing error.
This commit is contained in:
@@ -24,14 +24,14 @@ SELECT @hash = hash
|
||||
FROM sys.trusted_assemblies ta
|
||||
WHERE ta.description = N'SqlClrCurl'
|
||||
|
||||
EXEC sp_drop_trusted_assembly @hash;
|
||||
if (@hash is not null)
|
||||
EXEC sp_drop_trusted_assembly @hash;
|
||||
GO
|
||||
|
||||
--Drop the assembly if it already exists
|
||||
DROP ASSEMBLY IF EXISTS SqlClrCurl;
|
||||
GO
|
||||
|
||||
|
||||
DECLARE @assembly VARBINARY(MAX) = <#= "0x" + BitConverter.ToString(System.IO.File.ReadAllBytes(this.Host.ResolvePath("bin\\Release\\SqlClrCurl.dll"))).Replace("-","") #>
|
||||
DECLARE @hash VARBINARY(64);
|
||||
SELECT @hash = HASHBYTES('SHA2_512', @assembly)
|
||||
|
||||
Reference in New Issue
Block a user