deleting old journals

Im sure I am overlooking this, but how can I delete old journals to shrink the data base size?

This will not effect sales data correct?

Reply to
Zack Anderson
Loading thread data ...

HI zACK, First of all deleting the data no always reduce the file size, and it is already tested, second thing you are saying that you wanted to delete the journal so sales are correct then I would say that sales data are taken from [Transaction] and TransactionEntry table. Journal table is for viewing the receipt, wo, quote x/z reports actually the operations perform perform at POS. However below is query to delete the specifc or all data from Journal table but be carefull.

delete from Journal WHERE TIME>='2007-01-01' (remove the where clause so it will delete all records)

"Zack Anders> Im sure I am overlooking this, but how can I delete old journals to shrink

Reply to
Akber Alwani

Here is an SQL query for deleting journals more than a year old.

You can alter the number of days to whatever you require.

DELETE Journal WHERE time < getdate()-365

Disclaimer:

Always test any queries that modify data on a test database prior to running on your live data to ensure the desired results.

Always back-up prior to running any SQL delete queries on your live data.

Regards Michael (Brisbane, Australia)

Reply to
Michael

Zack,

I will do a backup between each part of database maintenance for our stores. I have lost one master in 10 years, so all slave register will get a backup copy to get the store back online quickly.

1st I will back up my database,

2nd run my del journal query,

3rd backup after database after del journal query

4th run re-index of database

5th backup after re-index of database

6th run shrinkdatabase query to allow for 10% growth

7th backup after shrinkdatabase

8th copy last back up to my other slave registers #2, #3, and #4. If master crash or die, I can promote one of the other to a master status in short time.

Ed

"Zack Anders> Im sure I am overlooking this, but how can I delete old journals to shrink

Reply to
Ed

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.