Thank you very much for the demo.
It seems maybe Im missing something but how can I find out what is these commands that it will show is comment or not, it now make it parted very good but how can I find out which one of them is runable and with one is comment?
@marcov: how?
My point was that a standard SQL parser won't be any good for parsing sql statements separated by comments only, since that is not valid SQL, and the way you want to fix it (valid SQL separated by commas) happens in two different layers (comments are killed already in the lexer but valid sql is only determined in the parser)
So you will need something custom you probably won't find ready-made. Smartest is to try to find some own set of heuristics to fix it (if comment on new line, and line before is like ... then insert ; or something like it). Parsing theory won't really help you here.