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 was created a while ago when I was doing some testing on a client system and wanted to quickly insert some creditor item numbers; in fact, it inserts a creditor item number for every single creditor/item combination.
/*
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).
*/
INSERT INTO dbo.IV00103
(ITEMNMBR
,VENDORID
,ITMVNDTY
,VNDITNUM
,QTYRQSTN
,QTYONORD
,QTY_Drop_Shipped
,LSTORDDT
,LSORDQTY
,LRCPTQTY
,LSRCPTDT
,LRCPTCST
,AVRGLDTM
,NORCTITM
,MINORQTY
,MAXORDQTY
,ECORDQTY
,VNDITDSC
,Last_Originating_Cost
,Last_Currency_ID
,FREEONBOARD
,PRCHSUOM
,CURRNIDX
,PLANNINGLEADTIME
,ORDERMULTIPLE
,MNFCTRITMNMBR)
--VALUES
(SELECT
IV101.ITEMNMBR
,PM2.VENDORID
,2
,IV101.ITEMNMBR
,0,0,0
,'1900-01-01 00:00:00.000'
,0,0
,'1900-01-01 00:00:00.000'
,0,0,0,0,0,0
,IV101.ITEMDESC
,0
,'' -- CURRENCY
,1,'',9,0,1,''
FROM
PM00200 AS PM2
CROSS JOIN
IV00101 AS IV101
LEFT JOIN
IV00103 AS IV103
ON
IV103.VENDORID = PM2.VENDORID
AND
IV103.ITEMNMBR = IV101.ITEMNMBR
WHERE
IV103.VENDORID IS NULL)
If you use this script, make sure you test thoroughly before running on a production system. After running the script, you may need to run an Inventory Reconcile.
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.
Looking for support or consultancy with Microsoft Dynamics GP?
I no longer work with Microsoft Dynamics GP, but the last company I worked for was ISC Software in the UK; if you’re looking for support or consultancy services with Microsoft Dynamics GP you can contact them here.