SQL Replication duplicate log reader in SQL replication monitor

It is upgrade time, Dynamics GP does not like schema objects bound by replication during upgrades. During version updates some tables are copied dropped and recreated, depending on what changes have been made to the schema. If replication is left running on a Dynamics GP company during the upgrade, then the upgrade will fail, if the object being replicated is change during the upgrade.

As a result, SQL replication has to be removed during the upgrade, after first scripting it out to SQL as a create so that it can be rebuilt post upgrade. During a recent upgrade, after rebuilding replication there were two log readers running for each publication. Oddly looking at the properties of the SQL log readers, they both reference the same source SQL jobs. This was causing issues trying to start and stop them or trying to change credentials as it all got a bit confusing. 

This has happened to me a few times now. The following command removes the extra log reader registration.

Selecting all the readers, from the replication distribution database where they are registered, simply choose the higher numbered duplicates for deletion, then remove them with the delete SQL command, using the ID from the table. 


WHERE id={duplicate ID #}
Now the table should be left with one reader per publication (unless you have a more complicated replication arrangement going on). 
replication monitor showing reader agents

Installing Word Addin GP, upgrade patch cannot be installed error

Windows installer error "upgrade patch cannot be installed by the windows installer service"

Switching on msi logging reveals the following extract form the log file:

MSI (c) (68:F8) [12:44:21:188]: Full optimizations are not possible in the patch sequencer because new patch[es] had been added in the current transaction.
MSI (c) (68:F8) [12:44:21:188]: Applicability checks need to be performed in this transaction because new, 3.0 minor update patch[es] have been provided.
MSI (c) (68:F8) [12:44:21:188]: PATCH SEQUENCER: verifying the applicability of minor upgrade patch {02407063-1528-1528-0000-DAC200E38416} against product code: {8A2F471F-31D3-4EAA-BE51-010078236C4C}, product version: 11.00.1269.000, product language 1033 and upgrade code: {DB086C81-9D50-4B21-80A0-DAC200E38416}
MSI (c) (68:F8) [12:44:21:188]: Validating transform 'RTM.1' with validation bits 0x921
MSI (c) (68:F8) [12:44:21:188]: Transform 'RTM.1' is valid.
MSI (c) (68:F8) [12:44:21:188]: Note: 1: 2262 2: _Tables 3: -2147287038
MSI (c) (68:F8) [12:44:21:188]: Note: 1: 2262 2: _Columns 3: -2147287038
MSI (c) (68:F8) [12:44:21:188]: PATCH SEQUENCER: minor upgrade patch {02407063-1528-1528-0000-DAC200E38416} is applicable.
MSI (c) (68:F8) [12:44:21:188]: PATCH SEQUENCER: verifying the applicability of minor upgrade patch \\{install Location}\SWDistbn\GP2015\MDGP2015_R2_DVD_ENUS\AdProd\BITemplateMapping\Bin\Updates\MicrosoftDynamicsGP14-BITemplateMapping-KB3063085-ENU.msp against product code: {8A2F471F-31D3-4EAA-BE51-010078236C4C}, product version: 11.00.1269.000, product language 1033 and upgrade code: {DB086C81-9D50-4B21-80A0-DAC200E38416}
MSI (c) (68:F8) [12:44:21:188]: Validating transform 'RTM.1' with validation bits 0x921
MSI (c) (68:F8) [12:44:21:188]: Note: 1: 2749 2: RTM.1 3: C:\Users\{user}\AppData\Local\Temp\e702854.msp 4: 14.00.0532.000 5: 11.00.1269.000
MSI (c) (68:F8) [12:44:21:188]: 1: 2749 2: RTM.1 3: C:\Users\{user}\AppData\Local\Temp\e702854.msp 4: 14.00.0532.000 5: 11.00.1269.000
MSI (c) (68:F8) [12:44:21:188]: PATCH SEQUENCER: minor upgrade patch \\{install Location}\SWDistbn\GP2015\MDGP2015_R2_DVD_ENUS\AdProd\BITemplateMapping\Bin\Updates\MicrosoftDynamicsGP14-BITemplateMapping-KB3063085-ENU.msp is not applicable.
MSI (c) (68:F8) [12:44:21:188]: The #_QFESequence table with patches sorted on Sequence within Patch Families:
MSI (c) (68:F8) [12:44:21:188]: PatchGUID: {02407063-1528-1528-0000-DAC200E38416} PatchFamily: BIPatch11 Sequence: 11.0.1528.0 SequenceOrder: 0 Type: minor upgrade
MSI (c) (68:F8) [12:44:21:188]: PATCH SEQUENCER: minor upgrade patch {02407063-1528-1528-0000-DAC200E38416} cannot be superseded because there is no supersedence defined in BIPatch11 family yet for this type
MSI (c) (68:F8) [12:44:21:188]: PATCH SEQUENCER: minor upgrade patch {02407063-1528-1528-0000-DAC200E38416} will attempt to supersede in BIPatch11 family, starting from sequence 11.0.1528.0
MSI (c) (68:F8) [12:44:21:188]: SequencePatches returns success.
MSI (c) (68:F8) [12:44:21:188]: Final Patch Application Order:
MSI (c) (68:F8) [12:44:21:188]: {02407063-1528-1528-0000-DAC200E38416} -
MSI (c) (68:F8) [12:44:21:188]: Other Patches:
MSI (c) (68:F8) [12:44:21:188]: Unknown\Absent: {03063085-0726-0726-0000-DAC200E38416} - \\{install Location}\SWDistbn\GP2015\MDGP2015_R2_DVD_ENUS\AdProd\BITemplateMapping\Bin\Updates\MicrosoftDynamicsGP14-BITemplateMapping-KB3063085-ENU.msp
The upgrade cannot be installed by the Windows Installer service because the program to be upgraded may be missing, or the upgrade may update a different version of the program. Verify that the program to be upgraded exists on your computer and that you have the correct upgrade.
MSI (c) (68:F8) [12:44:21:188]: Product: Microsoft Dynamics GP Add-in for Microsoft Word - Update '{03063085-0726-0726-0000-DAC200E38416}' could not be installed. Error code 1642. Additional information is available in the log file C:\Users\{user}\AppData\Local\Temp\MSI2853.LOG.

Version 14.00.0804 GP 2015 R2 with hotfix GP14-KB3080334-ENU.msp

I have a feeling that it might be this hot fix that is preventing the word addin installer from running?

Has anyone any experience of this?

“ta” eConnect stored procedures & upgrades a thought…

SQL Server Tree View Showing Pre and Post Procedures

eConnect presents a “pre” and “post” procedure for the various document transactions. This allows custom SQL scripts to be ran before and after eConnect transactions.

Beware, as anyone who works with eConnect will tell you, these procedures are DROPPED during version upgrades. This understandably makes developers wary of using them, for fear of problems after upgrades.

My current practice with these procedures is to have a single line call to another stored procedure that acts as a proxy. The proxy contains all the script I need to run. This means if someone ever forgets to take a copy before upgrade, it is very simple to restore without having lost any IP from the body of the script as it is only the pointer to the proxy that is lost.

I understand why for simplicity of upgrade scripts this is done this way. It also forces the developer to consider that the calling parameters may have changed if the table definition changes. However in every one of the scripts I have like this, they only consume the primary keys or other primary fields that are unlikely to grow or change data type.

It would be great to have a convention where anything between tags named something like this,

<!—User Script start –>


<!—User Script end –>

is stripped out by the upgrade script and injected into the new version of the stored procedures when they are created. I’m tempted to put something together like this for ourselves to automate the upgrade process. I could also script a search for stored procedures containing theses tags to iterate though them all making the changes pre and post upgrade.

Perhaps the pre upgrade run of this could also store the parameter names and types to compare after upgrade and this raise a warning where they have changed.   

GPUG Magazine Q2–2016 is available!

If you didn’t already know, there is a professional magazine for Dynamics GP. Published by the Dynamics GP User Group (GPUG). The magazine has hints & tips, conference and events listings, product and services advertisements that are relevant to the GP market. Also showcased are some of the benefits of joining GPUG. Go have a read!

 GPUG Q2 2016 Magazine Cover

Q2 magazine has an especially interesting article about the release of GP2016 on page 24 by an author who’s name you may well be already familiar with! It is an article commissioned and written before we started getting details of the release but also provides the links to the Microsoft team blog where up to date information is now available for GP2016.

This magazine there is an interesting article from Chad Sogge – group program manager at Microsoft. Should the opportunity arise, Chad is one of the most interesting people you can catch for a chat on developer topics, it is great that he spared some time to talk to the user group magazine!