Skip to Content

.NET Connector 3.0 and SQLServer CLR integration

Hi all,

I would like to do a RFC-call using the .NET-connector 3.0 from a SQLServer stored procedure.

I created a program to do the call in C# and this is working. Then I started to "convert" this to a project to create a dll containing a stored procedure to be used in SQLServer. Without references to sapnco and sapnco_utils it is working. But when I add the references, build the project and try to create the assembly in SQLServer I get the following error:

Msg 6544, Level 16, State 1, Line 2

CREATE ASSEMBLY for assembly 'FS SAPCalls' failed because assembly 'sapnco_utils' is malformed or not a pure .NET assembly.

Unverifiable PE Header/native stub.

When I leave out the reference to sapnco_utils in the .NET-project, I get the same error.

Is there any way to get this working?

Regards,

Maurice.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • avatar image
    Former Member
    Apr 01, 2011 at 11:52 AM

    Have you tried GACing sapnco and sapnco_utils ?

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Alan,

      I dragged the sapnco.dll and sapnco_utils.dll into the c:\windows\assembly folder, without problems.

      Is this what you mean by GACing the dll's?

      However I still get the same error with the CREATE ASSEMBLY for my 'FS SAPCalls.dll'.

      I also tried the following commands to load the sapnco and sapnco_utils into the SQLServer CLR:

      CREATE ASSEMBLY sapnco

      FROM 'C:\FS Application\FS SAPCalls\sapnco.dll'

      WITH PERMISSION_SET = UNSAFE

      GO

      This fails with the same error as with loading my "FS SAPCalls.dll"

      Next I tried:

      CREATE ASSEMBLY sapnco_utils

      FROM 'C:\FS Application\FS SAPCalls\sapnco_utils.dll'

      WITH PERMISSION_SET = UNSAFE

      GO

      This fails with the following error:

      Msg 6218, Level 16, State 3, Line 2

      CREATE ASSEMBLY for assembly 'sapnco_utils' failed because assembly 'sapnco_utils' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message

      Any help will be appreciated.

      Regards,

      Maurice.

  • avatar image
    Former Member
    Nov 11, 2011 at 04:18 PM

    Hi.

    Im having the same problem.

    Someone have solved it?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 26, 2013 at 06:46 AM

    Hi,

        Did you get any solution to your problem? As I'm also facing a similar kind of issue where it's not allowing me to deploy the SAPNCO.DLL and SAPNCO_UTILS.DLL into the SQL server. I did even try to create a Dot Net Dll which incorporates the SAP DLLs and then I deployed the Dot Net DLL into Sql Server. But no success. It saying me below error:

    TITLE: Microsoft SQL Server Management Studio
    ------------------------------

    Create failed for SqlAssembly 'SAPConnectorDLL'.  (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Create+SqlAssembly&LinkId=20476

    ------------------------------
    ADDITIONAL INFORMATION:

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

    ------------------------------

    Assembly 'sapnco, version=3.0.0.42, culture=neutral, publickeytoken=50436dca5c7f7d23.' was not found in the SQL catalog. (Microsoft SQL Server, Error: 6503)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3128&EvtSrc=MSSQLServer&EvtID=6503&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------

    Any help is appreciated.

    Add comment
    10|10000 characters needed characters exceeded