Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Help Groups for Snitz Forums 2000 Users
 Help: General / Classic ASP versions(v3.4.XX)
 Archive posts without using browser?
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

buono
Starting Member

20 Posts

Posted - 14 March 2005 :  04:29:10  Show Profile
Hi, My Snitz uses SQL erver 2000.

Is there an SQL script I can run that will archive my posts in the database rather than by using the Archive Admin option?

I have had a lot of activity and using the the admin option always timed out. I increased the timeout setting but it was running for 9 hours last night and did not complete. Obviously my site was running very slowly during that time.

I have this:

SELECT T_DATE, FORUM_REPLY.* FROM FORUM_REPLY LEFT OUTER JOIN FORUM_TOPICS ON FORUM_REPLY.TOPIC_ID = FORUM_TOPICS.TOPIC_ID WHERE T_LAST_POST < '20050301000000' AND FORUM_TOPICS.FORUM_ID IN (4, 1) AND T_ARCHIVE_FLAG <> 0

which will select each post to be archived but the logic to actually perform the archive is in a loop which I cannot replicate in pure SQL.

Any ideas?

Shaggy
Support Moderator

Ireland
6780 Posts

Posted - 14 March 2005 :  05:53:39  Show Profile
Have you tried running the archive in stages to try and avoid the timeout? I.e., Archive those posts older than a year first then 6 months and continue on down until you've archived all the posts you want to. If it's timing out on a year, you could make some edits to allow you to archive posts older than 18 months or 2 years first.


Search is your friend
“I was having a mildly paranoid day, mostly due to the
fact that the mad priest lady from over the river had
taken to nailing weasels to my front door again.”
Go to Top of Page

buono
Starting Member

20 Posts

Posted - 14 March 2005 :  07:46:13  Show Profile
Yes, tried that. That was the first thing I did.

I would rather use the database to do it instead of the asp page if possible.
Go to Top of Page

Podge
Support Moderator

Ireland
3776 Posts

Posted - 14 March 2005 :  08:44:32  Show Profile  Send Podge an ICQ Message  Send Podge a Yahoo! Message
See this thread - http://forum.snitz.com/forum/topic.asp?ARCHIVE=true&TOPIC_ID=47702

You could theoretically convert the script into a stored procedure and schedule it to run every so often. It is BETA so I would test it on a copy of your database first.

Podge.

The Hunger Site - Click to donate free food | My Blog | Snitz 3.4.05 AutoInstall (Beta!)

My Mods: CAPTCHA Mod | GateKeeper Mod
Tutorial: Enable subscriptions on your board

Warning: The post above or below may contain nuts.
Go to Top of Page

buono
Starting Member

20 Posts

Posted - 16 March 2005 :  05:23:53  Show Profile
That's exactly what I was after, I will give it a go at the weekend.

Many thanks for this.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.38 seconds. Powered By: Snitz Forums 2000 Version 3.4.07