According to T-SQL CREATE TABLE , in 2014, the column definition supports index definition:
<column_definition> ::= column_name <data_type> ... [ <column_index> ]
and grammar is defined as:
<column_index> ::= INDEX index_name [ CLUSTERED | NONCLUSTERED ] [ WITH ( <index_option> [ ,... n ] ) ] [ ON { partition_scheme_name (column_name ) | filegroup_name | default } ] [ FILESTREAM_ON { filestream_filegroup_name | partition_scheme_name | "NULL" } ]
Thus, much of what you can do as a separate statement can be made inline. I noticed that include not an option in this grammar, so some things are impossible.
CREATE TABLE MyTable( a int NOT NULL ,b smallint NOT NULL index IX_MyTable_b nonclustered ,c smallint NOT NULL ,d smallint NOT NULL ,e smallint NOT NULL )
You can also have inline indexes defined as another row after the columns, but inside the create table statement, and this allows multiple columns to be used in the index, but still not include clause:
< table_index > ::= { { INDEX index_name [ CLUSTERED | NONCLUSTERED ] (column_name [ ASC | DESC ] [ ,... n ] ) | INDEX index_name CLUSTERED COLUMNSTORE | INDEX index_name [ NONCLUSTERED ] COLUMNSTORE (column_name [ ,... n ] ) } [ WITH ( <index_option> [ ,... n ] ) ] [ ON { partition_scheme_name (column_name ) | filegroup_name | default } ] [ FILESTREAM_ON { filestream_filegroup_name | partition_scheme_name | "NULL" } ] }
For example, here we add an index for both columns c and d:
CREATE TABLE MyTable( a int NOT NULL ,b smallint NOT NULL index IX_MyTable_b nonclustered ,c smallint NOT NULL ,d smallint NOT NULL ,e smallint NOT NULL ,index IX_MyTable_c_d nonclustered (c,d) )