cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
CoreyZ
Level 5

Installing Assembly in SQL

I am creating a BasicMSI that installs scripts to a database. One of them creates an assembly in the database based off a DLL that is installed with the product.

When the script runs it errors out with:
Assembly 'MyAssembly' was not found in the SQL catalog of database 'MyDB'.

Originally I was using a text replacement which replaced a placeholder of the path/filename with the [INSTALLDIR]\MyAssembly.dll and then started making it less automated by hardcoding it in. The assembly is in the folder and yet it still errors out the same way.

Is this a limitation on the SQL scripting with InstallShield? Or am I missing the correct way of doing it?:confused:
Labels (1)
0 Kudos
(6) Replies
CoreyZ
Level 5

This is the script portion:
USE MyDB

CREATE ASSEMBLY MyAssemblyFunctions
FROM 'c:\Program Files (x86)\CompanyName\ProductName\Database\MyAssembly.dll'
WITH PERMISSION_SET = SAFE;
0 Kudos
hidenori
Level 17

If you run the same script from Microsoft SQL Server Management Studio, does it work?
0 Kudos
CoreyZ
Level 5

hidenori wrote:
If you run the same script from Microsoft SQL Server Management Studio, does it work?


Yes..........
0 Kudos
Christopher_Pai
Level 16

Can you post a log?

The SQL custom actions should scheduled after file installation by default. Perhaps you've played with it and have race condition.

Are you using the same credentials via InstallShield and Management Studio?
0 Kudos
CoreyZ
Level 5

Christopher Painter wrote:
Can you post a log?

The SQL custom actions should scheduled after file installation by default. Perhaps you've played with it and have race condition.

Are you using the same credentials via InstallShield and Management Studio?


I am trying but some encapsula is telling me I am being denied access to post anything aside from text.


Here is an excerpt from the log with the error

ADO Error: Number: -2147217900 Description: Assembly 'MyAssembly' was not found in the SQL catalog of database 'MyDB'. Source: Microsoft OLE DB Provider for SQL Server SQL State: 42000 Native Error: 6528
1: There was a SQL scripting error at line 17. Aborting the setup.


Yes, same credentials.

some stupid encapsula website protection error pops up when I attempt to paste in the code blocks with the SQL code being ran.
0 Kudos
Christopher_Pai
Level 16

Are you able to snapshot and rollback your entire environment to rule out external influences? If the test in IS and mangement studio the same database instance?

If you want, send a sample DLL and SQL snippet to chrpai@iswix.com and I'll play with it.
0 Kudos