Journal table in database

Anyone know what data the Journal table stores. I gather its either all the transaction data or a "picture of the receipt" The journal table is taking up 1.8GB of the total 2.6GB database. If the journal table is just a picture of the receipt, is there anyway I can just keep them if they are less than 30 days old, as I've never looked in the journal for something more than a few days old.

Cheers

Reply to
jetspeed
Loading thread data ...

Reply to
Nashat

Reply to
Akber Alwani

Thanks for the help guys

Each night I have a batch file that runs a couple of queries through sqlcmd, so basically all I have to do is add (make a backup before trying)

DELETE MyDatabaseName.dbo.Journal where time < getdate()-30

I remember reading somewhere that its not a good idea to run delete queries, because it doesn't perform the checks like RMS does. Would this be the case in this situation?

Cheers

Reply to
jetspeed

Reply to
Nashat

Ran the query on my test database, which worked fine. However, it made the database size nearly triple what it was before.

I then ran

DBCC SHRINKDATABASE (MyDatabaseName, 10) GO

And it went back to roughly the same size again

What the? I must be doing something here (maybe I need something to do with the truncate part in dbcc shrink?)

Cheers

Reply to
jetspeed

it might be something related to the recovery model, try to backup the transaction log then shrink the log file

Reply to
Nashat

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.