It looks like you are using MSSQL for your DB Server. I believe that JForum 2.1.8 only supports SQL 2005. Mainly because this is the first version of SQL to have decent support for "limit" type statements (but not using LIMIT...), which jForum uses a lot of.
FWIW, you should be looking first in the mssql.sql file and then the generic.sql files. The mssql specific queries will be there.
FWIW, some people have found ways to modify the queries to support older versions of MS SQL. See the forums for this.
Also, if you don't mind using a slightly older version of jForum, see:
This is a Torque based DAO (jforum data access layer) that I did for 2.1.6 that works with all MS SQL versions (we still have some V7 internal servers around... sigh) [originally posted on jforum.net by monroe]
TopicModel.selectHottestTopicsByLimit = SELECT * \
FROM ( SELECT ROW_NUMBER() OVER (ORDER BY t.topic_views DESC) AS rownumber, \
t.*, p.user_id AS last_user_id, p.post_time, p.attach AS attach \
FROM jforum_topics t, jforum_posts p \
WHERE p.post_id = t.topic_last_post_id \
AND p.need_moderate = 0 ) AS tmp \
WHERE rownumber <= ?
and bingo !! [originally posted on jforum.net by kallolb75]