I had a requirement to parse SQL string, in particular with CONTAINS(column_list) and modify SELECT column list.
I've found two most promising implementations General SQL Parser from http://www.sqlparser.com/ and SharpHSQL from http://www.c-sharpcorner.com/database/SharpHSQL.asp article.
General SQL Parser has quite qood API, but it doesn't have open source and doesn't recognize contains with column_list.
SharpHSQL is a early C# port of the HSQL Database Engine which has a source code, but also doesn't recognize CONTAINS(column_list) and additionally doesn't re-construct SQL from previously parsed SQL string. I've tried to add the functionality that I wanted,but it wasn't easy.
Finally I gave up with SharpHSQL code and used a few RegEx pattern to modify SQL as I needed. Unfortunately the code is not bullet-prove and will not work if sub-queries will be used in SELECT columns list.
Recently I was pointed to GOLD Parser Engine, which I didn't research yet.
posted @ Saturday, August 12, 2006 3:36 PM