Author |
Topic  |
|
Stefan Falz
Starting Member
12 Posts |
Posted - 13 December 2002 : 15:08:03
|
Hi,
i have a snitz forum version 3.4.03 (german) and today i want to archive some topics (8.000 Topics and 45.000 Replys). The function which inserts the data into the archive tables is very very slow (and buggy). After 15 minutes (on a P IV 2 GHz and SQL 2000) the database is corrupt. Therefore i have written a new function which processes the insertions and deletions in 15 seconds. Feel free to use the function in your forum.
http://www.aspforum.de/download/admin_forums.txt (Not 100 percent compatible while using non standard variables, but you should see, what it makes).
BTW: Sorry for my bad english ;)
I forgot one thing
You must change either FORUM_REPLY or FORUM_A_REPLY. The structure of those tables is different. The column R_STATUS is on another position. For the SQL-Statements: INSERT INTO ... SELECT * FROM ... both tables must have an identical structure.
Bye, Stefan |
Edited by - Stefan Falz on 13 December 2002 15:17:21 |
|
davemaxwell
Access 2000 Support Moderator
    
USA
3020 Posts |
Posted - 13 December 2002 : 15:09:52
|
8,000 topics and 45,000 replies. Is that how many topics you have, or how many you archived? |
Dave Maxwell Barbershop Harmony Freak |
 |
|
Stefan Falz
Starting Member
12 Posts |
Posted - 13 December 2002 : 15:12:49
|
quote: Originally posted by davemaxwell
8,000 topics and 45,000 replies. Is that how many topics you have, or how many you archived?
Archived. I archived all what is older than 3 months.
Bye Stefan |
 |
|
Stefan Falz
Starting Member
12 Posts |
Posted - 13 December 2002 : 15:15:37
|
I forgot one thing]
You must change either FORUM_REPLY or FORUM_A_REPLY. The structure of those tables is different. The column R_STATUS is on another position. For the SQL-Statements: INSERT INTO ... SELECT * FROM ... both tables must have an identical structure.
Bye, Stefan
|
 |
|
jlcox
Starting Member
7 Posts |
Posted - 18 January 2003 : 16:35:59
|
Thanks for the code, Stefan. Instead of modifying my table structure, I simply listed the fields in the SQL statement, i.e.,
strSQL = "INSERT INTO " & strTablePrefix & "A_REPLY (CAT_ID, FORUM_ID, TOPIC_ID, REPLY_ID, R_STATUS, R_MAIL, R_AUTHOR, R_MESSAGE, R_DATE, R_IP, R_LAST_EDIT, R_LAST_EDITBY, R_SIG) " & _ "SELECT CAT_ID, FORUM_ID, TOPIC_ID, REPLY_ID, R_STATUS, R_MAIL, R_AUTHOR, R_MESSAGE, R_DATE, R_IP, R_LAST_EDIT, R_LAST_EDITBY, R_SIG FROM " & strTablePrefix & "REPLY " & _ "WHERE TOPIC_ID IN ( SELECT " & strTablePrefix & "A_TOPICS.TOPIC_ID FROM " & strTablePrefix & "A_TOPICS )" |
 |
|
|
Topic  |
|
|
|