Tys
Tys

Reputation: 3610

Assembly xyz already exists in database

I have restored a database on another server. This database has SQL function that use .NET assemblies, which were installed on the previous server.

What is the easiest way to reinstall there assemblies?

If i just do

CREATE ASSEMBLY SQLHelpers

I get an error saying: Assembly SQLHelpers already exists in database

When i first try to remove by using

DROP ASSEMBLY SQLHelpers

I get: DROP ASSEMBLY failed because 'SQLHelpers' is referenced by object

I could alter all code in all functions, so that it looks like this assembly is not being used anymore, but isn't there a more simple way to update / reinstall / force install this thing?

Upvotes: 0

Views: 1422

Answers (1)

Mikael Eriksson
Mikael Eriksson

Reputation: 138980

To update an existing assembly you can use alter assembly SQLHelpers from ...

ALTER ASSEMBLY (Transact-SQL)

Upvotes: 1

Related Questions