Sqlcheck is a very simple command line tool to identify anti-patterns in SQL code It just takes a SQL file from you to analyze it and then shows output on the command prompt or terminal window. It thoroughly checks the SQL code and list the anti-patterns that it finds. It can find some most common type of anti patterns in the SQL code and show output. This tool runs on multiple platforms and it is open source as well. Currently, the different anti-patterns that it supports are logical database design based, physical database design based, query based, and application development based.
Anti-patterns in SQL are some most common types of mistakes that developers make which may lead to performance and data integrity problems. And that is why SQL code needs to be analyzed. If you have some SQL code to check then you can fed that to this simple tool and it will take care of the rest. It can detect anti-patterns related to Multi-Valued Attribute, Metadata Tribbles, String Concatenation, Nested sub queries, DISTINCT & JOIN Usage, Spaghetti Query Alert, Implicit Column Usage, Index Attribute Order, Readable Passwords, and some others.
How to use this SQL Antipatterns Identifier Command Line Tool?
This open source tool can easily be run on any platform. There are pre built binaries available for it and you can also compile from its source if you want to. So, simply download this tool from here for your platform and then you are done.
Now, simply open command prompt and then navigate to the folder where you have the SQL file that you want to check. Also, you can place the EXE file of Sqlcheck there and run the following command. It will analyze the SQL file and will show you the output. You can see below.
sqlcheck -f SQLFile -v
This way, you can use this simple tool to identify anti-patterns in SQL. And this is the only task that i can perform precisely in any SQL code. You can see then output that is produced in my case. And if you have some SQL files then you can use this tool on those as well. There are some other additional options for colored output, verbose that you can enable with some command line switches.
For maintaining database performance and integrity, SQL should be optimized. It generally contains some anti-patterns that may slow down the query execution time. So, its is better to identify them and the tool I have mentioned here is very helpful. You can identify some common as well as some rare anti-patterns in SQL code very easily.