You have two options.
Either execute the SQL statemet against the engine that it's written for or write your own SQL Syntax Parser.
You would, of course, have to write a "pluggable" parser to support the various dialects of SQL that are out there. SQL Server does not understand Oracle, nor is the reverse true. Then there's 4th Dimension, Adabas, Alpha Five, Cassandra, Derby, Altibase, BlackRay, CA-Datacom, Clarion, Clustrix, CSSQL, CUBRID, Daffodil, DataEase, Dataphor, dBase, EnterpriseDB, FileMaker Pro, Firebird, H2, IBM DB2, Lotus Approach, Ingres, Informix, InterBase, Linter, MaxDB, Access, FoxPro, Openbase, Virtuoso, Panorama, PostgreSQL, SQLBase, RDM, SmallSQL, SQLlite, ... Those are just the ones I can remember off the top of my head. There's probably dozens more.
Good luck with that!