Sage 200 Update - Failed to run SQL script

SOLVED

Hello all,

Whilst trying to update Sage 200, I'm getting the following error message: Failed to run SQL script 'Sage.Manufacturing.Database.Sql.UpdateScripts.16000200.sql' against company dataset.

Has anyone come across this before? Or any ideas hope I can find out what that SQL script is trying to update?

Thanks

James

  • 0
    Hi James,

    There can be a handful of reasons for this message, I will give a very high level overview of them here but I would recommend touching base with your business partner for this, or, if you are a business partner if you contact us on the technical support line we can advise in detail:

    1. You have a Manufacturing license but you have not installed the Manufacturing components. Check that the Manufacturing Core Components are present in System Administration.
    2. Customization/ bespoke affecting the upgrade. We can provide scripts to be ran in SQL to identify custom triggers (which should be disabled or removed during an upgrade). (Ask Sage Article 33751 provides this script)
    3. Bad view SQL script, we use this to identify customizations which may affect the update of the database.
    4. Issues with ReversedQuantity (please note this is Reversed and not Reserved). We have a script to identify a possible issue in the WOPIssue table which can cause this particular error
    5. Launch SQL Profiler and then attempt the update again. The Profiler log can then be interrogated to see if there is more detail to the issue, IE it may identify an issue with a particular SQL Table or record.

    Regards
  • 0
    Hi Stuart,

    Thanks for the pointers, very much appreciated. It looks like it relates to the ReversedQuantity issue. Can you provide the script or detail on what the issue is here please?

    Thanks

    James
  • 0
    verified answer
    Hi,

    If that is so then it has been seen where the WopIssue table is missing the ReservedQuantity column. The following script can be ran to resolve this. As ever run this against a copy of the database in a secure vanilla environment:


    IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'WOPIssue' AND COLUMN_NAME = 'ReversedQuantity')

    BEGIN

    -- TODO: Default Value

    exec('ALTER TABLE [dbo].WopIssue ADD ReversedQuantity StockQuantity null')

    exec('UPDATE [dbo].WopIssue SET ReversedQuantity = 0')

    exec('ALTER TABLE [dbo].WopIssue ALTER COLUMN ReversedQuantity StockQuantity NOT NULL')

    End

    GO

    Regards
  • 0
    Hi Stuart, thank you for your help on this, it has resolved our issues and we have successfully updated the database.
    I now have an issue when trying to deploy clients:
    Communication Error: There was no endpoint listening at sql-server-2016:10443/.../SystemAdminClientService.svc that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.

    The address looks right, I found a similar issue on the forum that led me to correct IIS Windows and Anonymous Authentication, but I'm not sure where to go next. Do you have any suggestions?
  • 0
    it could be firewall, proxy or something more complex. You'd be better off calling Sage200support for a live troubleshoot as it'd be difficult to troubleshoot via a forum post. You will be able to give a bit of history too as it sounds like its either an upgrade or moving server or both.
  • 0
    Gary, Stuart,

    Thank you both for your assistance. Between the Firewall pointer and the SQL script above, we appear to be up and running.