Добавьте файлы проекта.
This commit is contained in:
19
SQLLinter/Infrastructure/Rules/CrossDatabaseReferenceRule.cs
Normal file
19
SQLLinter/Infrastructure/Rules/CrossDatabaseReferenceRule.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using Microsoft.SqlServer.TransactSql.ScriptDom;
|
||||
using SQLLinter.Common;
|
||||
using SQLLinter.Common.Helpers;
|
||||
|
||||
namespace SQLLinter.Infrastructure.Rules;
|
||||
|
||||
public class CrossDatabaseReferenceRule : BaseRuleVisitor, IRule
|
||||
{
|
||||
|
||||
public override string Text => "Запрещено указывать имя базы данных в объекте. Используйте синонимы: {0}";
|
||||
|
||||
public override void Visit(NamedTableReference node)
|
||||
{
|
||||
if (node.SchemaObject.DatabaseIdentifier != null)
|
||||
{
|
||||
AddViolation(node, SQLHelpers.ObjectGetFullName(node.SchemaObject));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user