Skip to content

Commit d5eaad4

Browse files
committed
allow column ordering when creating index on multiple columns
1 parent 38e13c4 commit d5eaad4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tsql/tsql.g4

+5-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ create_database
220220

221221
// https://msdn.microsoft.com/en-us/library/ms188783.aspx
222222
create_index
223-
: CREATE UNIQUE? clustered? INDEX id ON table_name_with_hint '(' column_name_list (ASC | DESC)? ')'
223+
: CREATE UNIQUE? clustered? INDEX id ON table_name_with_hint '(' column_name_list_with_order ')'
224224
(INCLUDE '(' column_name_list ')' )?
225225
(WHERE where=search_condition)?
226226
(index_options)?
@@ -1210,6 +1210,10 @@ full_column_name
12101210
: (table_name '.')? id
12111211
;
12121212

1213+
column_name_list_with_order
1214+
: id (ASC | DESC)? (',' id (ASC | DESC)?)*
1215+
;
1216+
12131217
column_name_list
12141218
: id (',' id)*
12151219
;

0 commit comments

Comments
 (0)