Добавьте файлы проекта.
This commit is contained in:
18
SQLLinter/Infrastructure/Rules/TempTableDropRule.cs
Normal file
18
SQLLinter/Infrastructure/Rules/TempTableDropRule.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Microsoft.SqlServer.TransactSql.ScriptDom;
|
||||
using SQLLinter.Common;
|
||||
|
||||
namespace SQLLinter.Infrastructure.Rules;
|
||||
|
||||
public class TempTableDropRule : BaseRuleVisitor
|
||||
{
|
||||
public override string Text => "Нежелательно использовать DROP временных таблиц: {0}";
|
||||
|
||||
public override void Visit(DropTableStatement node)
|
||||
{
|
||||
var check = node.Objects.Where(o => o.BaseIdentifier.Value.StartsWith("#"));
|
||||
if (check.Any())
|
||||
{
|
||||
AddViolation(node, string.Join(", ", check));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user