SQL Prompt 9

SQL Code Analysis

SQL Prompt comes with a list of static code analysis rules you can run on your queries, as you review them, or as you type them. Static Code analysis parses the code as a compiler would, but for the purpose of with the objective of checking the syntax, rather than compiling it. For databases, static analysis is very useful in checking routines, such as functions and procedures, for 'code smells' that require code itself to be analysed.

The rules encourage good coding practices, and alert the team to code that, for example, flouts code style rules, uses deprecated syntax, demonstrate poor design (such as missing clustered indexes) or could at some point cause performance problems, unpredictable behavior, or even security vulnerabilities. This helps the team detect and correct issues early in the development cycle, increasing the reliability of database builds. It will allow the Governance and Operations team visibility into production readiness of the code, warning them of security loopholes and vulnerabilities, reducing the delays between build and deployment.


Additional Resources for SQL Code Analysis

In addition to this documentation, the Redgate Hub offers the following resources to help you find your way around SQL Code Analysis, learn how to use it, and adopt best practices :


Didn't find what you were looking for?