Files
SQLLint/SQLLinter/Infrastructure/Rules/UnionRule.cs

18 lines
479 B
C#

using Microsoft.SqlServer.TransactSql.ScriptDom;
using SQLLinter.Common;
namespace SQLLinter.Infrastructure.Rules;
public class UnionRule : BaseRuleVisitor
{
public override string Text => "Избегать UNION, использовать UNION ALL.";
public override void Visit(BinaryQueryExpression node)
{
if (node.BinaryQueryExpressionType == BinaryQueryExpressionType.Union && !node.All)
{
AddViolation(node);
}
}
}