serial number

Dec 21, 2007 2 Replies

I need to delet hundereds of old sold serial number because I need to shrink my DB. Is there way I can get script ? All the serials are under one item.


Hi Gill - first confirm your item id by typing your serial item itemlookupcode in XXX below (keep the single quotes) select id from item where itemlookupcode = 'XXX'

-- confirm and jot down the id assigned to the item - let's say its ID is123

The status field gets flagged with a "1" when the serial number has been sold - you could use this as a constraint in a where clause to only delete sold serial numbers -

BACKUP THE DB FIRST then run delete from serial where itemid = 123

-- this will delete ALL serial numbers associated with that item id

Have all of the serial numbers been sold? or are some still available for sale that you want to keep active? - h> I need to delet hundereds of old sold serial number because I need to shrink

Are you sure serial numbers are taking up that much space? It seems to me that serial numbers wouldn't take up that much room in the database. You would probably be better off deleting old journals, that way you would retain the sales info on all serial numbers. There has been a lot of discussion about deleting journals to free up space. Search the NG and you will get all the info you need. Craig

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required