This script is part of the SQL Scripts for Microsoft Dynamics GP where I will be posting the scripts I wrote against Microsoft Dynamics GP over the 19 years before I stopped working with Dynamics GP.
This script needs to be run in the destination database; the highlighted field is the source database.
It will update the segment descriptions in the destination database from the source database so they are the same,
The script was created for a client who did updates to descriptions in one database and wanted to roll these changes through quite a few other databases. Doing the update manually or using Integration Manager would have taken substantially longer, so the below script was created.
/*
Created by Ian Grieve of azurecurve | Ramblings of an IT Professional (http://www.azurecurve.co.uk)
This code is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0 Int).
*/
UPDATE
DESTINATION_TABLE
SET
DESTINATION_TABLE.DSCRIPTN = SOURCE_DB.DSCRIPTN
FROM
GL40200 AS DESTINATION_TABLE --Segment Description Master (GL40200)
INNER JOIN
THREE..GL40200 AS SOURCE_DB --Segment Description Master (GL40200)
ON
SOURCE_DB.SGMTNUMB = DESTINATION_TABLE.SGMTNUMB
AND
OTHER.SGMNTID = DESTINATION_TABLE.SGMNTID
If you use this script, make sure you thoroughly test before running on a production system and only after taking a good backup.
Click to show/hide the SQL Scripts for Microsoft Dynamics GP Series Index
What should we write about next?
If there is a topic which fits the typical ones of this site, which you would like to see me write about, please use the form, below, to submit your idea.