I\'d need to parse partial SQL queries (it\'s for a SQL injection auditing tool). For example
\'1\' AND 1=1--
Should break down into tokens lik
Also there may be some way to utilized fully parsed (by Microsoft) T-SQL via database editions of Visual studio -
The crown jewels of the Database Edition product are the SQL parsers and script generator, these two pieces form the foundation of what the database project system does internally.
http://blogs.msdn.com/b/gertd/archive/2008/08/21/getting-to-the-crown-jewels.aspx