Skip to content

Commit 1359634

Browse files
committed
Treat $ACTION as keyword in Transact-SQL
Fixes #810
1 parent 0d39810 commit 1359634

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Diff for: src/languages/transactsql/transactsql.keywords.ts

+2
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,8 @@ export const keywords: string[] = [
289289
'WRITE',
290290
'YEAR',
291291
'ZONE',
292+
// https://learn.microsoft.com/en-us/sql/t-sql/queries/output-clause-transact-sql?view=sql-server-ver16#action
293+
'$ACTION',
292294
];
293295

294296
export const dataTypes: string[] = [

Diff for: test/transactsql.test.ts

+8
Original file line numberDiff line numberDiff line change
@@ -197,4 +197,12 @@ describe('TransactSqlFormatter', () => {
197197
CREATE TABLE foo (name char(65));
198198
`);
199199
});
200+
201+
// Issue #810
202+
it('supports special $ACTION keyword', () => {
203+
expect(format(`MERGE INTO tbl OUTPUT $action AS act;`)).toBe(dedent`
204+
MERGE INTO
205+
tbl OUTPUT $action AS act;
206+
`);
207+
});
200208
});

0 commit comments

Comments
 (0)