Mahendra
Mahendra

Reputation: 1

Exception is coming on Non Clustered index in sql

I am trying to create nonclustered index on table :

Create nonclustered index ON Table_Name(Column_name) Go

But on execution it shows error :

Incorrect syntax near the keyword 'ON'.

Upvotes: 0

Views: 883

Answers (1)

Matt Stephenson
Matt Stephenson

Reputation: 8620

You need to name your index. Try

CREATE NONCLUSTERED INDEX IDX_Foo ON Table(Column);
GO

Upvotes: 2

Related Questions