diff --git a/src/languages/transactsql/transactsql.keywords.ts b/src/languages/transactsql/transactsql.keywords.ts index 9bedf6cc0..f24d7967d 100644 --- a/src/languages/transactsql/transactsql.keywords.ts +++ b/src/languages/transactsql/transactsql.keywords.ts @@ -289,6 +289,8 @@ export const keywords: string[] = [ 'WRITE', 'YEAR', 'ZONE', + // https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-ver16#action + '$ACTION', ]; export const dataTypes: string[] = [ diff --git a/test/transactsql.test.ts b/test/transactsql.test.ts index 0fe818a84..e63a4a419 100644 --- a/test/transactsql.test.ts +++ b/test/transactsql.test.ts @@ -197,4 +197,12 @@ describe('TransactSqlFormatter', () => { CREATE TABLE foo (name char(65)); `); }); + + // Issue #810 + it('supports special $ACTION keyword', () => { + expect(format(`MERGE INTO tbl OUTPUT $action AS act;`)).toBe(dedent` + MERGE INTO + tbl OUTPUT $action AS act; + `); + }); });