Thursday, March 1, 2012

a nonclustered index in MSSQL

I took the SQL I wrote here and put a nonclustered index (an index that does NOT require unique values) on the Name column in the Person table like so:

CREATE NONCLUSTERED INDEX myindex ON [Person] ( [Name] ASC ) ON [PRIMARY]

 
 

I could then use it like so:

SELECT * FROM Person WITH (INDEX (myindex))

 
 

I could eventually wash my hands of it like this:

DROP INDEX myindex ON [Person]

 
 

Some helpful links:

No comments:

Post a Comment