Creating Indexes on a Create Table Statement.
Applies to: Microsoft SQL Server 2014.
SQL Server 2014 allows to create a table and its indexes on one CREATE TABLE
statement as shown below:
CREATE TABLE [dbo].[Employees](
[EmployeeId] [int] IDENTITY(1,1) PRIMARY KEY CLUSTERED,
[LastName] [varchar](50) NULL,
[FirstName] [varchar](50) NULL,
[SSN] [varchar](50) NULL,
INDEX DBA_IX_Employees_SSN NONCLUSTERED (SSN)
) ON [PRIMARY]
GO
Reference.
CREATE TABLE (SQL Server).