SQL SERVER – Upgrade Error – Cannot Drop the Assembly ‘ISSERVER’, Because it Does not Exist or You Do Not Have Permission

SQL
1 Comment

SQL SERVER - Upgrade Error - Cannot Drop the Assembly ‘ISSERVER’, Because it Does not Exist or You Do Not Have Permission xerror A few days back, I published the blog on the same error message and one of the blog reader responded and ask how can I generate the script if I don’t have another SQL Server? In this blog, we would learn how to fix error Cannot drop the assembly ‘ISSERVER’, because it does not exist or you do not have permission.

Here is the earlier blog for your reference which talks about one solution to fix the error.

SQL SERVER – Cannot Drop the Assembly ‘ISSERVER’, Because it Does not Exist or You do not Have Permission

SQL ERRORLOG shows this:

Setting database option SINGLE_USER to ON for database ‘SSISDB’.
———————————-
Starting assembly upgrade
———————————-
Altering assembly [ISSERVER]
Error: 50000, Severity: 16, State: 127.
Cannot drop the assembly ‘ISSERVER’, because it does not exist or you do not have permission.
Error: 50000, Severity: 16, State: 127.
Cannot drop the assembly ‘ISSERVER’, because it does not exist or you do not have permission.
Creating function internal.is_valid_name
Error: 6528, Severity: 16, State: 1.
Assembly ‘ISSERVER’ was not found in the SQL catalog of database ‘SSISDB’.

I mentioned in an earlier blog to script the assembly from some other server and create it on a problematic server. One of my blog readers said –

I don’t have any other instance of SQL Server with the same version. Can I not use some other method?”

This was indeed a very valid ask. I spent some time on the internet, captured profiler while deploying the SSISDB database and found below in the profiler.

DECLARE @path NVARCHAR(255)
DECLARE @fullPath NVARCHAR(255)
EXEC master..xp_regread 'HKEY_LOCAL_MACHINE', @keypath, N'', @path OUTPUT
SET @fullPath = REPLACE( @path, '''', '''''' ) + N'Binn\Microsoft.SqlServer.IntegrationServices.Server.dll'
--PRINT(@fullPath);
-- Use OpenRowset to read the binary bits into @asm_bin
print ('DECLARE @asm_bin varbinary(max);
SELECT @asm_bin = BulkColumn FROM OPENROWSET (BULK N''' + @fullPath + ''',SINGLE_BLOB) AS dll
CREATE ASSEMBLY ISSERVER FROM @asm_bin WITH PERMISSION_SET = UNSAFE');

After running this, I got below statement as output

DECLARE @asm_bin varbinary(max);  
SELECT @asm_bin = BulkColumn FROM OPENROWSET (BULK N'd:\Program Files\Microsoft SQL Server\120\DTS\Binn\Microsoft.SqlServer.IntegrationServices.Server.dll',SINGLE_BLOB) AS dll
CREATE ASSEMBLY ISSERVER FROM  @asm_bin  WITH PERMISSION_SET = UNSAFE

The output might vary based on your SQL Server version.

Remember that you might be running into this when SQL is not getting started so you need to start SQL with trace flag 902 to bypass upgrade scripts, run CREATE ASSEMBLY and then restart SQL without trace flag. If you want to know about steps to enable trace flag, please read my earlier blog. SQL SERVER – What is Trace Flag – An Introduction

Please comment and let me know if this blog has helped you in solving upgrade issue.

Reference: Pinal Dave (https://blog.sqlauthority.com)

, ,
Previous Post
Why is SQL Server Consolidation Better Than Having a Scattered Environment?
Next Post
SQL SERVER – FIX: 3637 – A Parallel Operation Cannot be Started From a DAC Connection

Related Posts

1 Comment. Leave new

  • Pinal, script generates error:
    Msg 137, Level 15, State 2, Line 3
    Must declare the scalar variable “@keypath”.

    Please repost. Thank you in advance.

    Reply

Leave a Reply

Menu