Enables the powerful SonarTSQL analyzer.
First Analysis of a T-SQL Project
- Install SonarQube Server (see Setup and Upgrade for more details)
- Install SonarQube Scanner and be sure your can call sonar-scanner from the directory where you have your source code
- Install SonarTSQL (see Installing a Plugin for more details)
Run your analysis with the SonarQube Scanner by executing the following command from the root directory of the project:
sonar-scanner -Dsonar.projectKey=xxx -Dsonar.sources=.
- Follow the link provided at the end of the analysis to browse your project's quality in SonarQube UI
Assuming steps 1-3 above have already been completed, you'll want to encapsulate your analysis parameters in a sonar-project.properties file at the root of your project (see a sample project on GitHub: https://github.com/SonarSource/sonar-scanning-examples/tree/master/sonarqube-scanner). Then subsequent analyses can simply be run with:
With SonarTSQL, you can:
- change the files to analyze by configuring the property
sonar.tsql.file.suffixes in Settings > General Settings > T-SQL > File Suffixes
SonarTSQL shares the '
.sql' file extension (or suffix) with SonarPLSQL. Which means that if both analysers are deployed on the same SonarQube instance something should be done to ensure proper operations. The simplest solution is to remove the '
.sql' suffix from one of the 2 analysers in the General Settings of the SonarQube server. Then use the project properties (
sonar-project.properties) to override this when necessary. See Analysis Parameters for details.