20 lines
512 B
C#
20 lines
512 B
C#
using Microsoft.SqlServer.TransactSql.ScriptDom;
|
|
using SQLLinter.Common;
|
|
|
|
namespace SQLLinter.Infrastructure.Rules;
|
|
|
|
public class LinkedServerReferenceRule : BaseRuleVisitor, IRule
|
|
{
|
|
|
|
public override string Text => "Запрещены межсерверные запросы: {0}";
|
|
|
|
public override void Visit(NamedTableReference node)
|
|
{
|
|
if (node.SchemaObject.ServerIdentifier != null)
|
|
{
|
|
AddViolation(node, node.SchemaObject.ServerIdentifier.Value);
|
|
}
|
|
}
|
|
|
|
}
|