Skip to main content
Kofax

Error when trying to restore an SQL database to an other SQL server with ShareScan v5

Error when trying to restore an SQL database to an other SQL server with ShareScan v5

Problem:

The following error message may appear when trying to run an existing CLR object or create an assembly that has the external_access or unsafe permission set on a database that is attached or restored from a different server.

An error occurred in the Microsoft .NET Framework while trying to load assembly id 65536.

Note: If the user restores (on server B) a ShareScan database from a backup (from server A), it will be performed successfully, and everything seems to be correct.

Cause:

This problem occurs because the login that was used to create the database on Server A is not in the instance of SQL Server on Server B.  The issues occur even if the user has already set the "Trustworthy" database property to "ON".

This issue is described in further detail in Microsoft KB Article 918040.

Solution:

  1. Open a Command Prompt window in administrative mode.
  2. Run the following command line:

sqlcmd -S [SQLSERVER] -U sa -P [sa_password] -d eCopyShareScan -Q "EXEC sp_changedbowner 'sa'"

Note: Where the [SQLSERVER] parameter is the name of the SQL Server (with instance name, if the DB is hosted in a named SQL Server instance), and [sa_password] is the password of the sa user.

Example:

sqlcmd -S ph-dbserver -U sa -P e+C0py2007_@x -d eCopyShareScan -Q "EXEC sp_changedbowner 'sa'"

(the password is the default password for the sa user in case of the typical installation, when the ShareScan installer installs the SQL Server [on a local machine])