ErikEJ.DacFX.TSQLAnalyzer
1.0.19
Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
Requires NuGet 5.0 or higher.
dotnet add package ErikEJ.DacFX.TSQLAnalyzer --version 1.0.19
NuGet\Install-Package ErikEJ.DacFX.TSQLAnalyzer -Version 1.0.19
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ErikEJ.DacFX.TSQLAnalyzer" Version="1.0.19" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ErikEJ.DacFX.TSQLAnalyzer" Version="1.0.19" />
<PackageReference Include="ErikEJ.DacFX.TSQLAnalyzer" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ErikEJ.DacFX.TSQLAnalyzer --version 1.0.19
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: ErikEJ.DacFX.TSQLAnalyzer, 1.0.19"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#addin nuget:?package=ErikEJ.DacFX.TSQLAnalyzer&version=1.0.19
#tool nuget:?package=ErikEJ.DacFX.TSQLAnalyzer&version=1.0.19
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
ErikEJ.DacFX.TSQLAnalyzer
This .NET 8 library allows you to run 140+ static T-SQL code analysis rules against .sql files, and report any rule violations.
Installation
Install the latest package from NuGet.
Getting started
Once installed, you can use the library to analyze T-SQL files. The library comes with a couple of useful extension methods to help you format the output of the analysis.
using ErikEJ.DacFX.TSQLAnalyzer;
using ErikEJ.DacFX.TSQLAnalyzer.Extensions;
var files = new List<string> { "C:\\scripts\\sproc.sql" };
var analyzerOptions = new AnalyzerOptions();
analyzerOptions.Scripts.AddRange(files);
var analyzerFactory = new AnalyzerFactory(analyzerOptions);
AnalyzerResult result;
try
{
result = analyzerFactory.Analyze();
}
catch (ArgumentException aex)
{
Console.WriteLine(aex.Message);
return 1;
}
if (result?.Result == null)
{
Console.WriteLine("No result from analysis");
return 1;
}
foreach (var err in result.Result.InitializationErrors)
{
Console.WriteLine(err.Message);
}
foreach (var err in result.Result.SuppressionErrors)
{
Console.WriteLine(err.Message);
}
foreach (var err in result.Result.AnalysisErrors)
{
Console.WriteLine(err.Message);
}
if (result.ModelErrors.Count > 0)
{
foreach (var dex in result.ModelErrors)
{
Console.WriteLine(dex.Value.Format(dex.Key));
}
}
if (result.Result.AnalysisSucceeded)
{
foreach (var err in result.Result.Problems)
{
var warning = err.GetOutputMessage(analyzerOptions.Rules);
Console.WriteLine(warning);
}
}
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net8.0
- editorconfig (>= 0.15.0)
- ErikEJ.DacFX.SqlServer.Rules (>= 2.0.0-preview.8)
- ErikEJ.DacFX.TSQLSmellSCA (>= 2.0.0-preview.8)
- Microsoft.SqlServer.DacFx (>= 162.5.57)
- Microsoft.SqlServer.TransactSql.ScriptDom (>= 170.28.0)
- System.ComponentModel.Composition (>= 8.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.22 | 72 | 4/24/2025 |
1.0.21 | 172 | 4/16/2025 |
1.0.20 | 127 | 4/10/2025 |
1.0.19 | 128 | 4/9/2025 |
1.0.18 | 121 | 4/9/2025 |
1.0.17 | 128 | 4/7/2025 |
1.0.16 | 60 | 4/4/2025 |
1.0.15 | 249 | 3/23/2025 |
1.0.14 | 70 | 3/21/2025 |
1.0.13 | 139 | 3/19/2025 |
1.0.12 | 137 | 3/19/2025 |
1.0.11 | 132 | 3/19/2025 |
1.0.10 | 102 | 2/24/2025 |
1.0.9 | 89 | 2/24/2025 |
1.0.8 | 91 | 2/23/2025 |
1.0.7 | 90 | 2/19/2025 |
1.0.6 | 91 | 2/19/2025 |
1.0.0 | 133 | 3/19/2025 |
0.9.0-preview.2 | 56 | 2/19/2025 |
0.9.0-preview.1 | 59 | 2/19/2025 |
.dacpac and SQL Server support