SQL Trigger

Problem

Various DCOM settings can cause problems with SQL Trigger calls to NLINK.

Stored Procedure Creation Script           

To create an extended stored procedure to call the NLINK Server (running on the same machine as SQL Server or different machine). With NLINK Server version 5.x or later use the sp_NLINK.sql script which is available from Junot Systems. (See attachments list at the end of this page.)

  

When SQL Trigger calls the NLINK Server and the NLINK Server is not in a running state, by default, the operating system tries to start the NLINK Server. This can cause problems. Auto-starting of the NLINK Server can be prevented using the following steps:

  1. Run “dcomcnfg” from the command line.

  2. Navigate to “Component Services->Computers->My Computer->DCOM Config->NLINK”

  3. Open the Properties window for the NLINK application.

  4. Select the “Security” tab.

  5. In the “Launch and Activation Permissions” section, choose “Customize” and click the “Edit…” button.

  6. For “Group or user names” listed, in permissions window, uncheck “Allow” and “Deny” for “Local Launch” and “Remote Launch”.

Now NLINK can only be started from the Service Control Manager (SCM) or the NLINK Management Module (NMM).

  

If the NLINK Server and Microsoft SQL Server are on different computers, then DCOM security settings have to be properly configured for the trigger to work. The instructions assume that you are familiar with, and have the appropriate privileges to be able to perform systems administration tasks on your Windows system.

Configure DCOM the Computer running the NLINK Server:

  1. Run “dcomcnfg” from the command line.

  2. Navigate to “Component Services->Computers->My Computer”

  3. Open the Properties window for “My Computer”.

  4. Select the “COM Security” tab.

  5. In the “Launch and Activation Permissions” section, click the “Edit Limits” button.

  6. Select the “Everyone” group and check the “Allow” check-box for “Remote Activation”.

  7. Navigate to “Component Services->Computers->My Computer->DCOM Config->NLINK”

  8. Open the Properties window for the NLINK application.

  9. Select the Security tab.

  10. In the “Launch and Activation Permissions” section, choose “Customize” and click the “Edit…” button.

  11. Add the domain “Authenticated Users” group and allow “Remote Activation”.



May need additional “Launch and Activation Permissions” settings if the Microsoft SQL Server machine and NLINK Server machines are started with specific accounts (e.g. Microsoft SQL Server service is started with specific account rather than using “Local System Account”).



Windows Firewall (or any similar application) may also cause issues. Please contact your on-site systems administration professionals for help regarding Firewalls.

Configure DCOM on the SQL Server computer:

  1. If NLINK Server is not installed on the machine, then create proper registry entries. Import the NLink Connector.reg file (see Attachment list at the end of this page) into the registry.

  2. Run “dcomcnfg” from the command line.

  3. Navigate to “Component Services->Computers->My Computer->DCOM Config”

  4. Open the Properties window for “NLINK”

  5. Select the “Location” tab.

  6. Un-check “Run application on this computer”.

  7. Check “Run application on the following computer:”

  8. Enter the name of the host computer on which NLINK is installed.

  

  

Testing Trigger Stored Procedures          

Use the Test sp_NLINK new.sql script (see Attachments list at the end of this page).

Look at values returned in @ErrorMsg, to debug issues.



Attachments

In some cases, the Download All link may not work. However, you should still be able to download each file individually.

  File Modified

File sp_NLINK.sql

Oct 05, 2021 by Darcy Curtin

File NLink Connector.reg

Oct 05, 2021 by Darcy Curtin

File Test sp_NLINK new.sql

Oct 05, 2021 by Darcy Curtin