You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BACKUP_PRIORITY does not parse while using clause ADD REPLICA ON #222
BACKUP_PRIORITY does not parse while using clause ADD REPLICA ON it expects APPLY_DELAY instead.
GRANT, CREATE and ANY does not parse in ALTER AVAILABILITY GROUP Clause.
Steps to reproduce -
Try parsing the below SQL script with the parser:
ALTER AVAILABILITY GROUP [SalesAG]
ADD REPLICA ON 'SQL-NODE03\PROD_INSTANCE' WITH (ENDPOINT_URL = 'TCP://SQL-NODE03.corp.local:5022', FAILOVER_MODE = MANUAL, AVAILABILITY_MODE = ASYNCHRONOUS_COMMIT, BACKUP_PRIORITY = 50, SEEDING_MODE = AUTOMATIC, PRIMARY_ROLE(READ_ONLY_ROUTING_LIST = ('SQL-NODE03\PROD_INSTANCE', 'SQL-NODE02\PROD_INSTANCE')), SECONDARY_ROLE(READ_ONLY_ROUTING_URL = 'TCP://SQL-NODE02.corp.local:1433', ALLOW_CONNECTIONS = ALL));
ALTER AVAILABILITY GROUP [SalesAG] GRANT CREATE ANY DATABASE;
Example -
using Microsoft.SqlServer.TransactSql.ScriptDom;
internal class Program
{
static void Main(string[] args)
{
var script = "Example Script";
var parser = new TSql180Parser(true);
var fragment = parser.Parse(new StringReader(script), out var parseErrors);
if (parseErrors.Count > 0)
{
foreach(var parseError in parseErrors)
Console.WriteLine(parseError.Message);
}
else
{
Console.WriteLine("Parsed successfully");
}
}
}
Error message :-
Expected APPLY_DELAY but encountered BACKUP_PRIORITY instead.
Incorrect syntax near 'GRANT'.
Incorrect syntax near 'CREATE'.
Incorrect syntax near 'ANY'.```
Activity