|
I need a non clustered index on a column in one of my databases, what is the T-SQL to create that?
(comments are locked)
|
(comments are locked)
|
|
Just clarifying a bit... For a non-clustered index
For a unique non-clustered index
(comments are locked)
|
|
aw, heck! what about an example?
but in the heat of the moment I might write
(comments are locked)
|
|
Dont forget, if you are using SSMS, that there are examples of lots of scripts like this in the templates. Hit Ctrl+Alt+T to see the template toolbar and then open the Index folder to see six different examples of index creation scripts. The Create Unique Nonclustered Index script would be closest to the one you want. Drag that to a new script window and edit it as the other answers have suggested, using an index name of your choice and the columns you need to have indexed. Then you simply need to make sure you are in the right database and run the script!
(comments are locked)
|
|
Phil has a good answer, and keep in mind that you can use multiple columns in the index. Choose the columns that are often used in the
(comments are locked)
|
1 2 next page »

