TSQL parser program with ANTLR4 and great contributors.
tsql
sql parser
sqlparser -o xml -s "select * from tab1 join tab2 on tab1.a=tab2.b"
sqlparser -o json -s "select * from tab1"
this program support
- dml
- merge
- delte
- insert
- select
- update
- ddl
- alter
- create
- drop
- etc
- backup statement
- flow control statement
- begen
- break
- if
- goto
- return
- throw
- try
- etc
git clone https://github.com/GCer-Hidenori/ANTSQLParser.git
- XML
sqlparser -o xml -s "select * from tab1 join tab2 on tab1.a=tab2.b"
- json
sqlparser -o json -s "select * from tab1 join tab2 on tab1.a=tab2.b"
- string
sqlparser -o json -s "select * from tab1 join tab2 on tab1.a=tab2.b"
- file
sqlparser -o json -f select01.sql -e utf-8