<?xml version='1.0' encoding='UTF-8'?>
<!--
  ~ Copyright (c) DbVis Software AB. All Rights Reserved.
  -->
<sql:Dialect tag="SQL Server" validIdentifiers="#@$" xmlns:sql="http://dbvis.com/sql-dialect.xsd" references="
   https://docs.microsoft.com/en-us/sql/t-sql/statements/create-procedure-transact-sql
   https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-procedure-transact-sql
   
   https://docs.microsoft.com/en-us/sql/t-sql/statements/create-function-transact-sql
   https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-function-transact-sql
   
   https://docs.microsoft.com/en-us/sql/t-sql/statements/create-trigger-transact-sql
   https://docs.microsoft.com/en-us/sql/t-sql/statements/alter-trigger-transact-sql
   
   https://docs.microsoft.com/en-us/sql/t-sql/language-elements/control-of-flow
   https://docs.microsoft.com/en-us/sql/relational-databases/databases/database-identifiers

   ">
   
   
   <sql:ComplexStatement begin="{CREATE | ALTER | CREATE OR ALTER} {PROC | PROCEDURE | FUNCTION | TRIGGER}" end="GO" end.include="false" comment="We override default delimiters end enforce a complex statement to be terminated with GO" />
   
   <!-- these can occur both as root level statements and inside a complex statement; since complex statements are terminated with "GO", we only handle these as root level statements -->
   <sql:ComplexStatement begin="IF" end="GO" end.include="false" />
   <sql:ComplexStatement begin="BEGIN TRANSACTION" end="" end.override="false" comment="This is simply to avoid confusion with the 'BEGIN - END' statement" />
   <sql:ComplexStatement begin="BEGIN" end="END" />
   <sql:ComplexStatement begin="BEGIN TRY" end="END TRY" />
   <sql:ComplexStatement begin="BEGIN CATCH" end="END CATCH" />
   
</sql:Dialect>