Delete Items associated with supplier

Is there any kind of query that will allow me to delete all items associated with a specific supplier or all products not associated with any supplier?

Thanks.

coupleofdogs

Reply to
coupleofdogs
Loading thread data ...

The short answer is yes, but are you sure you don't want to simply inactivate the items rather than deleting them? Deleting items is usually bad if there is any transaction history with them. Reports become funky when you start to delete items... I wouldn't do it...

Reply to
Jason

Thaks for the quick response. I am trying to clean up the database to ultimately speed things up. I have several thousand items/suppliers that we no longer order or need records for. Will making an item inactive accomplish the same?

Thanks.

"Jas> The short answer is yes, but are you sure you don't want to simply

Reply to
coupleofdogs

Inactivating the items will do the trick. There is little speed advantage to deleting items I have found...

************************* BACKUP BACKUP BACKUP *************************

You can do a variety of SQL queries based on the required criteria.

First, to find the supplier ID you are interested in:

SELECT suppliername,ID from supplier

Then, to make sure you have the right items:

SELECT description from item where supplierid = XXX (where XXX is the supplier ID you found in the prior step)

Then, once you confirm you have the right items:

UPDATE item SET inactive = 1 where supplierid = XXX

If you want to inactivate ALL items where there is no supplier:

UPDATE item SET inactive = 1 where supplierid = 0

If you make a mistake and want to reactivate ALL items (use your backup or...):

UPDATE item SET inactive = 0

Have fun!

Reply to
Jason

Reply to
coupleofdogs

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.