Data Repair Techniques for Microsoft Dynamics GP Great Plains

May 13
09:22

2007

Andrew Karasev

Andrew Karasev

  • Share this article on Facebook
  • Share this article on Twitter
  • Share this article on Linkedin

If you have large number of transactions in your ERP, it is natural to expect data inconsistency to occur from time to time. If this happens, you need SQL DBA skills and some understanding of GP tables structure and effect of records changing.

mediaimage

Before you do SQL data repair,Data Repair Techniques for Microsoft Dynamics GP Great Plains Articles please think about end-user options, such as check links, plus research tools available in routines and utilities sections.  If you got to do data repair, read the following introduction level article

  • Dexterity table backup.  As Microsoft Great Plains is successor of Great Plains Software Dynamics – it has the features of Great Plains Dexterity.  On the features is this – each table is required to have identity column – DEX_ROW_ID.  When you need to backup just one table you use the following script:

Select * into IV00101_Backup from IV00101.  In this script you need to replace IV00101 with the table that you intend to backup.  In order to know table name, go to tools->resource descriptions->tables

  • Table restore.  If you would like to restore your GP tables from backup, described above, you need to run these scripts:

Alter table IV00101_Backup drop column DEX_ROW_ID

Delete table IV00101  (this script is very dangerous – it will delete all your inventory item master records, so please, be sure what you are doing, meaning that you really need to restore from backup and no new items were created since the time of backup)

Insert into IV00101 select * from IV00101_Backup

  • Table Update.  Now you are facing the situation, when you manager asks you to update specific fields in your live table from your backup table.  Here are the directions:

Update IV00101 set CURRCOST=b.CURRCOST from IV00101 a join IV00101_Backup b on a.ITEMNMBR=b.ITEMNMBR – this statement will rollback current cost from backup table

  • Some useful queries. 

Delete ACTIVITY where USERID=’sa’ – this will remove ‘sa’ from GP and will allow this user to login back.

Update SY00500 set BCHSTTUS = 0 where BACHNUMB=’YOURBATCH’update SY00500 set MKDTOPST = 0 where BACHNUMB=’YOURBATCH’

These two scripts will reset the batch. Failed to post (when your workstation crashed).  If they don’t do the whole job, look at SY00800 table in DYNAMICS database

Article "tagged" as:

Categories: