OK, I solved the problem with "MS SQL Server", but this plugin will only work with the version of "MS SQL 2005" and above.
I corrected the 2 bugs:
1) The bug related to 'LIMIT-OFFSET' (for "MS SQL Server" has replaced another expression, other databases will use 'LIMIT-OFFSET').
2) The bug related to expression "DISTINCT" and field 'ofMessageArchive.body' ("DISTINCT" can not work with the type "ntext", so I changed it to "nvarchar(max)". http://technet.microsoft.com/en-us/library/ms187993%28v=sql.90%29.aspx).
I hope it will work