Quantcast
Channel: Dynamics GP Land : forecaster
Viewing all articles
Browse latest Browse all 240

Run a SQL script across all Dynamics GP company databases

$
0
0
By Steve Endow

This may be posted elsewhere, but I just whipped it up quickly and thought I would post it for posterity.

If you need to run a SQL script across all Dynamics GP company databases, this is one way.  There are likely other ways, but this approach is actually relatively simple compared to the alternatives.


USEDYNAMICS
DECLARE@INTERIDvarchar(10)
DECLAREINTERID_CursorCURSORFOR
SELECTINTERIDFROMDYNAMICS..SY01500

OPENINTERID_Cursor

FETCHINTERID_CursorINTO@INTERID

WHILE@@Fetch_Status= 0
BEGIN
  EXEC('UPDATE '+@INTERID+'..SOP10100 SET WorkflowApprStatCreditLm = 9 WHERE BACHNUMB LIKE ''ABC%'' AND WorkflowApprStatCreditLm = 1')
  FETCHINTERID_CursorINTO@INTERID
END

CLOSEINTERID_Cursor
DEALLOCATEINTERID_Cursor




Steve Endow is a Microsoft MVP for Dynamics GP and a Dynamics GP Certified IT Professional in Los Angeles.  He is the owner of Precipio Services, which provides Dynamics GP integrations, customizations, and automation solutions.

You can also find him on Google+ and Twitter



Viewing all articles
Browse latest Browse all 240

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>