Great Plains (GP 2010) Accounts Payable -- vendors with no activity

We have 55,000 vendors and 46,500 of these have never had any activity. These vendors are not in a certain range so I would probably need to delete them in SQL.  Is there more than one table involved.
pstreAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Steve EndowMicrosoft MVP - Dynamics GPCommented:
Interesting issue.

Rather than deleting 46,500 vendors--if they have absolutely zero transaction activity, I'm wondering if it might be possible to use the Vendor Combiner tool to merge them all into one vendor, and then just delete that one vendor in GP.

It's probably a very unconventional approach, but it might be an alternative to deleting the records in SQL.  You could look into it and see if it's worth going through the process and using the tool, and if it would work.  

If you want to go with the SQL delete approach, if the vendors do not have any activity, I'm guessing that they might only have records in PM00200 (Vendor Master) and PM00300 (Vendor Address).  Those two tables would be the minimum you would have to touch.

But there could potentially be records in PM00201, PM00202, etc.  If you want to be thorough, you could run this statement, which lists all tables that contain the VENDORID field, and check the tables to see if the vendors exist in any of them.  (I show 121 tables, but most of those won't be relevant)

SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'VENDORID' ORDER BY TABLE_NAME

You would probably only need to check the IV, PM, and POP tables.

You could probably do some fancy SQL and convert the query above into a query that checks all of those tables to see if they contain any of the vendor IDs that need to be deleted, but I don't know how to do that off the top of my head.

You'll probably want to triple check to make sure the vendors don't have any activity (work, open, history), and obviously you'll want to test in a Test environment first, and make a SQL backup of Dynamics and the company database before deleting the vendors in a live environment.

Let me know if this helps and if you have any questions.

Thanks,

Steve Endow
Microsoft MVP - Dynamics GP
Dynamics GP Certified IT Professional
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Dynamics

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.