select * from #tprefix#messages order by posted asc

Total ## of messages: #msgs.recordCount#

update #tprefix#conferences set messages = 0 update #tprefix#forums set messages = 0 update #tprefix#threads set messages = 0 update #tprefix#threads set messages = messages + 1, lastpostuseridfk = , lastpostcreated = where id = select forumidfk from #tprefix#threads where id = update #tprefix#forums set messages = messages + 1, lastpostuseridfk = , lastpost = , lastpostcreated = where id = select conferenceidfk from #tprefix#forums where id = update #tprefix#conferences set messages = messages + 1, lastpostuseridfk = , lastpost = , lastpostcreated = where id = 1000 rows done.

Done updating.